Skip to content

Instantly share code, notes, and snippets.

View chrisfraser's full-sized avatar

Chris Fraser chrisfraser

View GitHub Profile
Verifying my Blockstack ID is secured with the address 1DJNp7oV98WuHjGKPuxpRqjbLeraR24SuF https://explorer.blockstack.org/address/1DJNp7oV98WuHjGKPuxpRqjbLeraR24SuF
@chrisfraser
chrisfraser / README.md
Created September 5, 2017 10:48 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

#include<Wire.h>
#include <Ultrasonic.h>
const int MPU = 0x68; // I2C address of the MPU-6050
const int LDR = A0;
const int BUTTON = 4;
const int RED = 15;
const int GREEN = 12;
const int BLUE = 13;
DEPEND: xtensa-esp108-elf-gcc -M -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -DICACHE_FLASH -I include -I ./ -I ../include -I /esptools/workspace/ESP32_RTOS_SDK/include -I /esptools/workspace/ESP32_RTOS_SDK/extra_include -I /esptools/workspace/ESP32_RTOS_SDK/include/lwip -I /esptools/workspace/ESP32_RTOS_SDK/include/lwip/ipv4 -I /esptools/workspace/ESP32_RTOS_SDK/include/lwip/ipv6 -I /esptools/workspace/ESP32_RTOS_SDK/include/espressif user_main.c
xtensa-esp108-elf-gcc -Os -g -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -DICACHE_FLASH -I include -I ./ -I ../include -I /esptools/workspace/ESP32_RTOS_SDK/include -I /esptools/workspace/ESP32_RTOS_SDK/extra_include -I /esptools/workspace/ESP32_RTOS_SDK/include/lwip -I /esptools/workspace/ESP32_RTOS_SDK/include/lwip/ipv4 -I /esptools/workspace/ESP32_RTOS_SDK/include/lwip/ipv6 -I /esptools/workspace/ESP32_RTOS_SDK/include/espress
@chrisfraser
chrisfraser / ButtonsAndRelays.ino
Last active January 19, 2016 12:51
Debounced buttons controlling outputs in arduino
// Consider hardware debouncing the buttons with a cap
const long debounceDelay = 50; // the debounce time; increase if there is chatter on the buttons
int buttons[] = {D1, D2, D3}; // Add your button pins here
int outputs[] = {D7, D8}; // Add your button pins here
// State variables
int outputState[] = {LOW, LOW}; // current state of the output pins
int buttonState[3]; // current reading from the buttons
int previousButtonState[] = {HIGH, HIGH, HIGH}; // previous reading from the buttons
@chrisfraser
chrisfraser / .hgignore
Created February 1, 2013 09:02
A full list of entries for the .hgignore file when using VS2012.
# use glob syntax
syntax: glob
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc