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 | |
if [ ! -f /var/run/pigpio.pid ]; then sudo pigpiod -s 1; sleep 0.5; fi | |
pigs hp 18 80 3 | |
raspivid -md 4 -w 1012 -h 760 -fps 80 -o tst.h264 -pts tst.pts -p 500,22,506,380 -t $(($1*1000 + 3000)) & | |
pid=$! | |
sleep 2 | |
pigs w 18 0 | |
sleep $1 | |
sudo ./nanopulse 39 1 9 |
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
// | |
// How to access GPIO registers from C-code on the Raspberry-Pi | |
// Example program | |
// 15-January-2012 | |
// Dom and Gert | |
// Revised: 15-Feb-2013 | |
// gcc -O6 -I/opt/vc/include -L/opt/vc/lib -lbcm_host dra.c -o dra | |
// Access from ARM Running Linux |
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
// | |
// How to access GPIO registers from C-code on the Raspberry-Pi | |
// Example program | |
// 15-January-2012 | |
// Dom and Gert | |
// Revised: 15-Feb-2013 | |
// gcc -O6 -I/opt/vc/include -L/opt/vc/lib -lbcm_host blink.c -o blink | |
// Access from ARM Running Linux |
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 /tmp | |
git clone https://git.busybox.net/busybox | |
cd busybox/miscutils | |
cat << EOF > libbb.h | |
#ifndef _libbbb_h | |
#define _libbbb_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
/* | |
gcc -Wall -pedantic -Wextra poke.c -o poke | |
ln -s poke peek && ln -s poke peek_l && ln -s poke poke_l | |
ln -s poke peek_s && ln -s poke peek_sl | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <libgen.h> | |
#include <arm-linux-gnueabihf/bits/stdint-uintn.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
/* | |
gcc -O6 -I/opt/vc/include -L/opt/vc/lib -lbcm_host gpio_base.c -o gpio_base | |
*/ | |
#include <stdio.h> | |
#include <bcm_host.h> | |
void main() { printf("%08x\n", bcm_host_get_peripheral_address() + 0x200000); } |
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 <Stepper.h> | |
#define STEPS 200 | |
Stepper stepper(STEPS, 8, 10, 9, 11); | |
#include <Keypad.h> | |
const byte ROWS = 4; | |
const byte COLS = 4; | |
char keys[ROWS][COLS] = { |
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 | |
date +%s > /home/pi/last_reboot | |
/bin/reboot |
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
/* | |
gcc -O6 -Wall -pedantic -Wextra pclkf.c -o pclkf | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <libgen.h> | |
//#include <arm-linux-gnueabihf/bits/stdint-uintn.h> | |
#include <fcntl.h> | |
#include <sys/mman.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
/* | |
gcc -O6 -Wall -pedantic -Wextra rcvf.c -o rcvf | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <libgen.h> | |
//#include <arm-linux-gnueabihf/bits/stdint-uintn.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> |