This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import time | |
def run_command(command, timeout_duration): | |
try: | |
# Execute the command with a timeout | |
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
stdout, stderr = process.communicate(timeout=timeout_duration) | |
# Print output and errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
#include <Adafruit_NeoPixel.h> | |
// Which pin on the Arduino is connected to the NeoPixels? | |
#define PIN 0 // On Trinket or Gemma, suggest changing this to 1 | |
// How many NeoPixels are attached to the Arduino? | |
#define NUMPIXELS 15 // Popular NeoPixel ring size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paint example specifically for the TFTLCD breakout board. | |
// If using the Arduino shield, use the tftpaint_shield.pde sketch instead! | |
// DOES NOT CURRENTLY WORK ON ARDUINO LEONARDO | |
#include <string.h> | |
#include <stdio.h> | |
#include <Adafruit_GFX.h> // Core graphics library | |
#include <Adafruit_TFTLCD.h> // Hardware-specific library | |
#include <TouchScreen.h> | |
#include <ArduinoJson.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
#include <Adafruit_NeoPixel.h> | |
// Which pin on the Arduino is connected to the NeoPixels? | |
#define PIN 0 // On Trinket or Gemma, suggest changing this to 1 | |
// How many NeoPixels are attached to the Arduino? | |
#define NUMPIXELS 15 // Popular NeoPixel ring size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net') | |
var readline = require('readline') | |
/** | |
* @class Client | |
* @param host {String} the host | |
* @param post {Integer} the port | |
*/ | |
function Client (host, port) { | |
this.host = host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
Serial.begin(9600); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for native USB port only | |
} | |
pinMode(5, OUTPUT); | |
delay(1000); |