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/python | |
| # turn on yellow LED when CD/DVD tray fully open, blue LED when fully closed | |
| import RPi.GPIO as GPIO | |
| import time | |
| GPIO.setmode(GPIO.BOARD) | |
| OPSW = 22 # G25 |
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/python | |
| import RPi.GPIO as GPIO | |
| import time | |
| GPIO.setmode(GPIO.BOARD) | |
| # Data and address pins | |
| # MSB first |
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
| 00000000 ?? 88 56 82 8c 6f 58 50 80 50 82 22 5d a0 b0 c2 |..V..oXP.P."]...| | |
| 00000010 20 86 c0 9a 82 94 79 6a 50 80 70 71 36 54 a0 b0 | .....yjP.pq6T..| | |
| 00000020 c2 20 82 92 58 88 96 6f 00 a0 80 70 81 02 4b a0 |. ..X..o...p..K.| | |
| 00000030 b0 c5 20 60 89 cb 80 70 60 00 a0 80 80 82 03 03 |.. `...p`.......| | |
| 00000040 a0 a8 cd 2c 84 f6 0c 20 61 c8 0c 20 61 c8 08 20 |...,... a.. a.. | | |
| 00000050 60 08 40 f4 40 43 40 f4 40 43 40 f4 42 41 ff ff |`.@.@C@.@[email protected]..| | |
| 00000060 00 11 00 7b 7b 7b 00 ff ff ff ff 7b 7b 7b 7b 00 |...{{{.....{{{{.| | |
| 00000070 ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 7b |...............{| | |
| 00000080 00 02 00 02 00 02 00 01 04 00 00 00 00 00 00 00 |................| | |
| 00000090 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 |................| |
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/python | |
| # write 16-bit EEPROMs over I2C | |
| import sys | |
| import smbus | |
| import time | |
| bus = smbus.SMBus(1) | |
| if len(sys.argv) < 2: | |
| sys.stderr.write("usage: %s device-address\n" % (sys.argv[0],)) |
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/python | |
| # read 16-bit EEPROMs over I2C. tested with 24FC512 and 24LC515 | |
| import sys | |
| import smbus | |
| bus = smbus.SMBus(1) # /dev/i2c-1 | |
| if len(sys.argv) < 3: | |
| sys.stderr.write("usage: %s device_address size > filename\n" % (sys.argv[0],)) | |
| raise SystemExit |
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
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: gpint | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Interrupt-based GPIO LED/pushbutton daemon | |
| # Description: Listens for button events and lights up LEDs | |
| ### END INIT INFO |
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/python | |
| # interrupt-based GPIO example using LEDs and pushbuttons | |
| import RPi.GPIO as GPIO | |
| import time | |
| import threading | |
| GPIO.setmode(GPIO.BOARD) |
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 <stdio.h> | |
| #include <crypt.h> | |
| int main(int argc, char **argv) { | |
| if (argc < 3) { | |
| fprintf(stderr, "usage: %s key salt\n", argv[0]); | |
| return -1; | |
| } | |
| char *result = crypt(argv[1], argv[2]); | |
| if (!result) |
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/python | |
| # Light up LEDs using GPIO in response to dump1090 flights | |
| ### MOVED TO https://github.com/rxseger/flightled | |
| import socket | |
| import select | |
| import time | |
| import datetime | |
| import os | |
| import RPi.GPIO as GPIO |
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
| #!/bin/sh | |
| #### MOVED TO https://github.com/rxseger/flightled | |
| ### BEGIN INIT INFO | |
| # Provides: flightled | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Light up LEDs when a watched flight is observed |