Skip to content

Instantly share code, notes, and snippets.

@soemarko
soemarko / SousVide-MK2.ino
Created June 22, 2020 17:05
Arduino powered Rice-cooker Sous Vide
#include <AutoPID.h>
#include <LiquidCrystal.h>
#include <max6675.h>
double currentTemp = 0.0;
double targetTemp = 60.0;
bool powerState = LOW;
//!MARK: LCD setup
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
#include <Servo.h>
int endstopPin = 7;
int val = 0;
Servo s;
int servoPin = 9;
int stowAngle = 30;
int deployAngle = 160;
@soemarko
soemarko / o2-analizer.ino
Created October 28, 2018 17:42
Source code for DIY O2 Analyzer, read the introduction here: http://soemarko.com/blog/diy-o2-analyzer-part-1
#include <SPI.h>
#include <Wire.h>
#include <Piccolino_OLED.h>
#include <Piccolino_RAM.h>
#include <EEPROM.h>
#include <Adafruit_ADS1015.h>
#include <RunningAverage.h>
const int buttonPin=3; // push button
import UIKit
class ClearTextButton: UIButton {
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
convenience init() {
@soemarko
soemarko / CalculatorViewController.swift
Last active March 23, 2017 18:31
Dead simple calculator in Swift 3
//
// Created by Soemarko Ridwan on 3/23/17.
// Copyright © 2017 Soemarko Ridwan. All rights reserved.
//
// Dependencies: (to simplify the code)
// - ActionKit: https://github.com/ActionKit/ActionKit/tree/swift3
// For closure style buttons
// - AutoLayout Helper: https://github.com/ustwo/autolayout-helper-swift
// I was never a fan of interface builder, a lot more across devices.
//
@soemarko
soemarko / spark-debugger.html
Created March 21, 2015 17:16
Spark Debugger
<!DOCTYPE html>
<html>
<script>
var source = new EventSource('https://api.spark.io/v1/devices/[DEVICE_ID]/events/?access_token=[ACCESS_TOKEN]');
source.addEventListener('logger', function(e) {
var p = document.createElement('p');
var d = JSON.parse(e.data);
p.innerHTML = d.data;
document.body.insertBefore(p, document.body.firstChild);
@soemarko
soemarko / RoastLoggerMax6675-Behmor.ino
Last active December 9, 2021 18:08
RoastLogger + MAX6675 + Behmor 1600
/****************************************************************************
RoastLoggerMax6675.ino
This sketch is for use with MAX 6675 thermocouple interface chips. A separate sketch
is available for MAX 31855 chips.
See the "Contributed Libraries" section of http://www.arduino.cc/en/Reference/Libraries
for details of how to install it.
@soemarko
soemarko / UIColor+Colours.h
Created May 26, 2013 19:16
Extending UIColor ... and extend more as needed. Hex conversion from http://stackoverflow.com/questions/4265161/how-to-convert-hexadecimal-to-rgb
//
// UIColor+Colours.h
//
// Created by Soemarko Ridwan on 25/05/13.
// Copyright (c) 2013 Soemarko Ridwan. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (Colours)
@soemarko
soemarko / autopager.js
Created May 20, 2012 08:41
tumblr infinite scroll
/**
A slight variant of http://rocketshake.tumblr.com/post/424849450/infinite-scroll
This file has been uploaded to http://static.tumblr.com/fpifyru/F4wm4bbxj/autopager.js
**/
var tumblrAutoPager = {
url: "http://proto.jp/",
ver: "0.1.7",
rF: true,
gP: {},
@soemarko
soemarko / app.js
Created November 27, 2011 06:15
Using webview to use prompt window with Titanium
var btn = Ti.UI.createButton({
title: 'Prompt!',
height: 40,
width: 100,
top: 20
});
var lbl = Ti.UI.createLabel({
text: 'Label',
textAlign: 'center'