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
int RXLED = 17; // The RX LED has a defined Arduino pin | |
// The TX LED was not so lucky, we'll need to use pre-defined | |
// macros (TXLED1, TXLED0) to control that. | |
// (We could use the same macros for the RX LED too -- RXLED1, | |
// and RXLED0.) | |
void setup() | |
{ | |
pinMode(RXLED, OUTPUT); // Set RX LED as an output | |
// TX LED is set as an output behind the scenes |
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
[Unit] | |
Description=/etc/rc.local Compatibility | |
ConditionPathExists=/etc/rc.local | |
[Service] | |
Type=forking | |
ExecStart=/etc/rc.local | |
TimeoutSec=0 | |
StandardOutput=tty | |
RemainAfterExit=yes |
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
String tmp; | |
void setup() { | |
Serial.begin(115200); | |
Serial1.begin(115200); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for Leonardo only | |
} | |
Serial.println("hello!"); |
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
byte inbuff[255]; | |
byte outbuff[255]; | |
#define rate 115200 | |
void setup() { | |
Serial.begin(rate); | |
while (!Serial) ; | |
Serial1.begin(rate); | |
while (!Serial1); |
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
/* YourDuino.com Example Software Sketch | |
DHT11 Humidity and Temperature Sensor test | |
Credits: Rob Tillaart | |
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=162 | |
terry@yourduino.com */ | |
/*-----( Import needed libraries )-----*/ | |
#include <dht11.h> | |
/*-----( Declare objects )-----*/ |
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
package server; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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( | |
"compress/flate" | |
"os" | |
"io" | |
) | |
func main(){ | |
inFile,err := os.Open("something.txt",os.O_RDONLY,0666) | |
if err != nil { panic(err.String())} | |
defer inFile.Close() |
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
static uint16 crc16(uint16 crc, uint8 val) { | |
const uint16 poly = 0x1021; | |
uint8 cnt; | |
for (cnt = 0; cnt < 8; cnt++, val <<= 1) | |
{ | |
uint8 msb = (crc & 0x8000) ? 1 : 0; | |
crc <<= 1; |
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
#!/bin/bash | |
cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS\ Build\ System\ Support.xcplugin/Contents/MacOS/ | |
dd if=iPhoneOS\ Build\ System\ Support of=working bs=500 count=255 | |
printf "\x8f\x2a\x00\x00" >> working | |
dd if=iPhoneOS\ Build\ System\ Support of=working bs=1 skip=127504 seek=127504 | |
/bin/mv -n iPhoneOS\ Build\ System\ Support iPhoneOS\ Build\ System\ Support.original | |
/bin/mv working iPhoneOS\ Build\ System\ Support | |
chmod a+x iPhoneOS\ Build\ System\ Support | |
mkdir /Developer/iphoneentitlements30 |
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)centerMap { | |
NSArray *coordinates = [self.mapView valueForKeyPath:@"annotations.coordinate"]; | |
CLLocationCoordinate2D maxCoord = {-90.0f, -180.0f}; | |
CLLocationCoordinate2D minCoord = {90.0f, 180.0f}; | |
OlderNewer