{"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