This file contains hidden or 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
| *.bak |
This file contains hidden or 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 spwm(int freq, int pin, int spd) { | |
| digitalWrite(pin, HIGH); | |
| delayMicroseconds(spd * freq); | |
| digitalWrite(pin, LOW); | |
| delayMicroseconds(spd * (255 - freq)); | |
| } | |
| int delay = 15; | |
| void loop() { |
This file contains hidden or 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
| #define __STDC_LIMIT_MACROS 1 | |
| #include <stdint.h> | |
| #include <avr/sleep.h> | |
| #include <avr/interrupt.h> | |
| void setup() { | |
| pinMode(0, OUTPUT); | |
| pinMode(2, INPUT); | |
This file contains hidden or 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
| #define __STDC_LIMIT_MACROS 1 | |
| #include <stdint.h> | |
| #define BOFF 2 | |
| #define BON 3 | |
| #define RS 3 | |
| #define EN 4 | |
| int bitmap[] = {6, 7, 8, 13, 12, 11, 10, 9 }; |
This file contains hidden or 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 open_device(char *device, int speed); | |
| #define AT_REQUEST 0x08 | |
| #define REMOTE_AT_REQUEST 0x17 | |
| #define AT_RESPONSE 0x88 | |
| #define REMOTE_AT_RESPONSE 0x97 | |
| struct at_response { | |
| uint8_t api_id, frame_id; | |
| uint8_t cmd[2]; |
This file contains hidden or 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 <unistd.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include "xbee.h" | |
| #include "lcd.h" | |
| static int send_sync(int fd, uint8_t *remote, char *cmd, uint8_t *data, uint16_t n) | |
| { |
This file contains hidden or 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 <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <fcntl.h> | |
| #include <termios.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <stdio.h> |
This file contains hidden or 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 <EEPROM.h> | |
| #define MOTION 1 | |
| #define SWITCH 0 | |
| #define LIGHT 2 | |
| #define LDR 3 | |
| #define HZ 4 | |
| #define SAMPLES (15*HZ) | |
| #define ON_DELAY (15*60*HZ) |
This file contains hidden or 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
| #!/usr/bin/perl | |
| use warnings; | |
| use Xbee::API; | |
| use Data::Dumper; | |
| my $port = "/dev/ttyUSB0"; | |
| my $end_device = "0013a20040769646"; | |
| my $remaddr = pack( "H*", $end_device ); | |
| my $devaddr = pack( "H4", "fffe" ); |
This file contains hidden or 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
| #define LIGHT 5 | |
| #define MOTION 0 | |
| #define SWITCH 1 | |
| #define LEDS 2 | |
| #define DUSK 4 | |
| #define HZ 4 | |
| #define SAMPLES (15*HZ) | |
| #define ON_DELAY (30*60*HZ) | |
| #define OFF_DELAY (15*HZ) |