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
#define debug | |
void setup() { | |
// put your setup code here, to run once: | |
//analogReadResolution(12); // STM32F103, 12 bits adc resolution // Allwrong, this should work but doesn't. Fortunately, in contrast to documentation, a 12 bit result turns out te be the default on this board. | |
if(Serial); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: |
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
#define STEPSPERROT (200) | |
#define MICROSTEPS (16) | |
#define INTERVALS (512) | |
#define MAGNETIZETIME (200) // miliseconds the magnet is powered. Hint from Aart: short, high current pulses (dump a capacitor) work best. | |
#define LEDPIN 17 // not 13 on pro micro, but 17 | |
//#define DEBUG | |
#define FULLROTSTEPS (STEPSPERROT*MICROSTEPS) | |
#define STEPSPERINTERVAL (FULLROTSTEPS/INTERVALS) |
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
/* | |
Basic ESP8266 MQTT example, editted for "Grote Schakelaar". REMINDER: PAS DE NETWERKINSTELLINGEN AAN! En zet de topics goed. (En soldeer even een bordje maar dat is minder vergeetbaar) | |
It connects to an MQTT server then: | |
- subscribes to the topic "inTopic", printing out any messages | |
it receives. NB - it assumes the received payloads are strings not binary | |
- If the first character of the topic "inTopic" is an 1, switch ON the ESP Led, | |
else switch it off | |
- Publishes to a topic set below a value set below (hardcoded) |
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 <ctype.h> | |
const int sp = 0; // speaker pin | |
char tekst[] = "pas wijze lynx bezag vroom het fikse aquaduct 1234567890"; // test tekst | |
const int mlen = 80; // morse length | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(sp,OUTPUT); |
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
// MainsSensor. | |
// doel: op zuinige attiny (attiny10? attiny45?) bij opstarten en elke paar minuten op 433Mhz eigen ID zenden, en bij wegvallen van de voeding een afmeldbericht sturen (Met de energie uit een elco) met datzelfde ID. | |
// PORTB1 data output | |
// PORTB2 = INT0 watch powerloss (same pin on both t45 and t10) | |
#define t45 | |
//#define t10 | |
// TODO: Please note: do not forget to edit the makefile as well when changing MCU between attiny45 and attiny10 (in 2 places), and when using t45, set its fuses correctly. |
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 | |
# Anpassung für big endian unter RHEL 7 | |
WDIR=~ | |
while true; do | |
stty -F /dev/ttyUSB0 9600 raw | |
INPUT=$(dd conv=swab bs=10 count=1 </dev/ttyUSB0 2>/dev/null | od -x -N10 |head -n 1|cut -f2-10 -d" "); | |
#Ausgabe | |
#echo $INPUT |
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
[empty file, added to change gist title] |
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
/* | |
* 10x 9443 display module | |
* Aart 06-2021 | |
* | |
* Logic board: | |
* | |
* 34_pin function register function | |
* | |
* 1,2,3,4 V+ | |
* |
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
/* | |
* 10x PD2437 display module | |
* aangepast vanaf het voorbeeld van Aart | |
* | |
* Logic board: | |
* | |
* 34_pin function register function | |
* | |
* 1,2,3,4 V+ | |
* |
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 <msp430.h> | |
#include <stdbool.h> | |
/** | |
* slim solarlampje. | |
* Doel: | |
* aan net voor zonsopgang tot zonsopgang, | |
* aan na zonsondergang, maar beperkte tijd (niet hele nacht) | |
* dus de "vorige" zonsondergang/opgang onthouden. | |
* |
OlderNewer