Skip to content

Instantly share code, notes, and snippets.

@markterrill
markterrill / esp32_key_gen.go
Created November 25, 2020 10:31
./mos -X esp32-gen-key flash_encryption_key ~/git-repo/sfmosv1/htdigest/fe.key --esp32-enable-flash-encryption --esp32-read-key --dry-run=false --port $SFPORT
//
// Copyright (c) 2014-2019 Cesanta Software Limited
// All rights reserved
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@markterrill
markterrill / iOS-colors.css
Created September 12, 2020 06:24 — forked from nummi/iOS-colors.css
iOS Colors
.theme--light {
--SystemRed: rgba(255, 59, 48, 1);
--SystemOrange: rgba(255, 149, 0, 1);
--SystemYellow: rgba(255, 204, 0, 1);
--SystemGreen: rgba( 52, 199, 89, 1);
--SystemTeal: rgba( 90, 200, 250, 1);
--SystemBlue: rgba( 0, 122, 255, 1);
--SystemIndigo: rgba( 88, 86, 214, 1);
--SystemPurple: rgba(175, 82, 222, 1);
--SystemPink: rgba(255, 45, 85, 1);
#include "application.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
STARTUP(prepare());
void prepare() {
#include "application.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
SYSTEM_THREAD(ENABLED);
STARTUP(prepare());
void prepare() {
/**
* Copyright 2017, Google, Inc.
* Licensed under the Apache License, Version 2.0 (the `License`);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an `AS IS` BASIS,
#define FAN1 D0 // A4 on old board, A0 on new board but photon doesn't have PWM etc on A0
// PWM
//#define PWM_FREQ 25000 // in Hertz (SET YOUR FREQUENCY) for analogWrite2
// TURN DEBUG ON?
#define MYDEBUG TRUE
int tinkerAnalogWrite(String command);
@markterrill
markterrill / testpwm.ino
Last active November 17, 2015 10:04
particle photon PWM
#define FAN1 D0 // A4 on old board, A0 on new board but photon doesn't have PWM etc on A0
// PWM
//SystemCoreClock = 120MHz, period = 4000 @ 30Khz
#define PWM_FREQ 30000 // in Hertz (SET YOUR FREQUENCY)
// Loop variables
int percent = 10, increase = 2;
unsigned long lastTime = 0UL;
@markterrill
markterrill / aws-sns-example.js
Last active August 29, 2015 14:27 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@markterrill
markterrill / gist:30e4e32192862addd47b
Created May 5, 2015 10:57
Spark core Maverick ET73 probe
#include "math.h"
#define PROBE1 A7
#define DEBUG TRUE
#define SMOOTH TRUE
// Measure actual board voltage, from 3v3* to GND with voltage multimeter, it's rarely exactly 3.3
const float VREF = 3.3200;
// What resistor did you use from 3v3* to between the analog pin and positive pin of thermistor?