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
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
Most Arduinos have an on-board LED you can control. On the Uno and | |
Leonardo, it is attached to digital pin 13. If you're unsure what | |
pin the on-board LED is connected to on your Arduino model, check | |
the documentation at http://arduino.cc | |
This example code is in the public domain. |
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
/* | |
* The manualpage of strftime notes: | |
* "The environment variables TZ and LC_TIME are used." | |
* | |
* What it does not say is that in order to get the locale | |
* to actually work in your program is that 2 things are | |
* needed in the code: | |
* #include <locale.h> | |
* and | |
* setlocale(LC_TIME, ""); |
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
/* | |
This example program reads a value from a file. This file can be updated | |
from another program, while this main program never needs to stop. | |
gcc -O2 -Wall -o readtempfromfile readtempfromfile.c | |
*/ | |
#include <stdio.h> | |
#include <stdlib.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
/* | |
Program that keeps an eye on a (private) thingspeak channel + field and | |
acts upon change in value of that field. When the value increases, | |
a system call to blink1-tool is called to colour the blink(1) led | |
pumpkin orange. | |
There are some commandline options: | |
-v for VERBOSE | |
-a for the apikey | |
-c for the thingspeak channel |
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
/* | |
Spotify catcher | |
Functions as a "man in the middle" for the Spotify Client scrobbles that | |
go to post.audioscrobbler.com (last.fm). | |
Works on an esp8266 (Arduino IDE). Connect an oled to pin 3 (SDA) and | |
pin4 (SCL) to show the currently playing song. | |
Make sure you put the IP of the esp9266 into /etc/hosts with the name |
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 <stdint.h> | |
#include <ctype.h> | |
#include <string.h> | |
typedef struct | |
{ | |
char *command; | |
char *parameter1; |
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: gcc -o sine sine.c -lm -Wall | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <math.h> | |
#define PI 3.14159265 |
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 <stdarg.h> | |
#include <unistd.h> | |
#include <stdint.h> | |
#include <math.h> | |
#include "pigpio.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
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/ioctl.h> | |
#include <linux/types.h> | |
#include <linux/spi/spidev.h> | |
#include <stdint.h> | |
#include <stdio.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 | |
# https://learn.adafruit.com/adafruits-raspberry-pi-lesson-8-using-a-servo-motor/software | |
gpio -g mode 18 pwm | |
gpio pwm-ms | |
gpio pwmc 192 | |
gpio pwmr 2000 | |
while [ 1 -gt 0 ] | |
do |