Skip to content

Instantly share code, notes, and snippets.

@rac2030
rac2030 / pakman-code.ino
Created July 2, 2018 18:11
PakMan project done during the last few hours of the MakeZurich hackathon using a Teensy 3.6, a HC05 BT module and interfacing a FMLR LoRa button from MiroMico emulating button presses
#include <Arduino.h>
#include <ArduinoJson.h>
#include <EEPROM.h>
#include <Snooze.h>
#include <Wire.h>
#include <sensirion_ess.h>
#define INTERVAL 1000
#define PIN_BT_EN 2
#define PIN_ISR 7
#define PIN_LORA 8
@rac2030
rac2030 / compile log with debug true
Last active June 30, 2018 00:38
Reboot loop in bootloader after arduino esp32 sketch build
/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/rac/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/rac/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/rac/Documents/Arduino/libraries -fqbn=esspresif:esp32:nina_w10:UploadSpeed=921600 -ide-version=10805 -build-path /Users/rac/arduino-builds-tmp -warnings=none -build-cache /var/folders/ml/drsxdr5n0jg5631n428wm_tr0000gn/T/arduino_cache_567123 -prefs=build.warn_data_percentage=75 -verbose /Users/rac/Documents/Arduino/tryouts/BareMinimum/BareMinimum.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/rac/Library/Arduino15/packages -tools /Applications/Arduino.app/
#include <esp_sleep.h>
// Identifier of the badge, used for communication
uint64_t chipid;
// PINS
// Buttons
const byte BTN1 = D19;
const uint64_t BTN1_mask = 1ULL << BTN1;
const byte BTN2 = D8;
@rac2030
rac2030 / speedometer-duemillanova.ino
Created June 15, 2018 23:03
EIn unfinished project, wir haben ein Vorderrad eines Fahrades mit Nabnmotor über einen Voltage Divider an einen Analog pin gemacht und entsprechend die Geschwindigkeit anhand des rad umfanges und der umdrehungen pro minute (aus den Pulsen des Nabenmotors) die Geschwindigkeit auf einem OLED ausgegeben.
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <EEPROM.h>
/** the current address in the EEPROM (i.e. which byte we're going to write to next) **/
int addr = 0;
#define OLED_RESET 4 // not used / nicht genutzt bei diesem Display
/*
* light_ws2812 example
* Fade LEDs in R, G, B order; demonstrate functions for changing color order.
*
* Created: September 6, 2014
* Author: Windell Oskay (www.evilmadscientist.com)
*/
#include <FastLED.h>
/*
* LED siren example for MakeZurich badge 2018
*/
#include "FastLED.h"
#define NUM_LEDS 2
#define DATA_PIN 27 // GPIO18
// Delays used inside siren algorithm
/*
* i2c_port_address_scanner
* Scans ports D0 to D7 on an ESP8266 and searches for I2C device. based on the original code
* available on Arduino.cc and later improved by user Krodal and Nick Gammon (www.gammon.com.au/forum/?id=10896)
* D8 throws exceptions thus it has been left out
*
*/
#include <Wire.h>
#include "FastLED.h"
@rac2030
rac2030 / Google Group Authorization checker
Created March 7, 2013 23:46
Check for authorization with google groups member from appscript
function doGet(request) {
var group = GroupsApp.getGroupByEmail(request.parameter.group);
var result = {
authorized: group.hasUser(request.parameter.mail)
};
return ContentService.createTextOutput(JSON.stringify(result)).setMimeType(ContentService.MimeType.JSON);
}