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 [[ rgb2fb.c -nt rgb2fb ]]; then | |
echo "compiling rgb2fb.c"; gcc -O6 -Wall -pedantic -Wextra rgb2fb.c -o rgb2fb | |
fi | |
if [[ "$#" > 0 ]]; then t=$1; else t=600000; fi | |
raspividyuv -fps 90 -rgb -o - -pts $0.pts \ | |
-md 7 -w 640 -h 480 -n -t $t -awb greyworld | \ | |
./rgb2fb 640 480 F 2> $0.txt |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <linux/fb.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
#!/bin/bash | |
if [[ rgb2fb.c -nt rgb2fb ]]; then | |
echo "compiling rgb2fb.c"; gcc -O6 -Wall -pedantic -Wextra rgb2fb.c -o rgb2fb | |
fi | |
if [[ "$#" > 0 ]]; then t=$1; else t=600000; fi | |
raspividyuv -fps 135 -rgb -o - -pts $0.pts \ | |
-md 7 -w 640 -h 480 -n -t $t -awb greyworld | \ | |
./rgb2fb 640 480 0 2> $0.txt |
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 -o toggle toggle.c -lpigpio -lrt -lpthread | |
$ | |
Usage: | |
$ sudo killall pigpiod | |
$ sudo ./toggle 30 & | |
$ raspivid -md 1 -w 1920 -h 1080 -p 22,50,960,540 -o tst.h264 -fps 30 -t 8000 -pts tst.pts | |
$ ./ptsanalyze tst.pts 0 | |
$ # https://github.com/Hermann-SW/userland/blob/master/tools/ptsanalyze |
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 | |
while true | |
do | |
fin_wait2=`netstat 2>/dev/null | grep 1337` | |
if [[ "$fin_wait2" = "" ]] | |
then | |
sudo ./dead-man_button | |
else | |
sudo ./dead-man_button 1338 | |
fi |
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 [[ "$1" == "" || ${1: -4} != ".ino" ]]; then | |
echo -e "Usage:\n"`basename $0`" file.ino\nsudo ./file" | |
exit | |
fi | |
wrapper=`cat << EndOfWrapper | |
#include <time.h> | |
#include <unistd.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
/* | |
Compile and link | |
gcc -O6 -I/opt/vc/include -L/opt/vc/lib -lbcm_host -o nanoflash nanoflash.c | |
Run example (gpioDpin rising edge => o[ns] offset => d[ns] gpio18 pwm flash) | |
$ sudo killall pigpiod | |
$ sudo ./nanoflash o d | |
*/ |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#define N (32768+18580480) | |
int main(int argc, char* argv[]) | |
{ | |
FILE *src; |
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
/* | |
Compile and link | |
gcc -I/opt/vc/include -L/opt/vc/lib -lbcm_host -o nanopulse nanopulse.c | |
Run example (10000 10 nanosecond pulses with 2000 nano second gap) | |
sudo ./nanopulse 10 10000 2000 | |
*/ |