Skip to content

Instantly share code, notes, and snippets.

View remcoder's full-sized avatar
👓
software engineer -- obsessed with 3d printing

Remco Veldkamp remcoder

👓
software engineer -- obsessed with 3d printing
View GitHub Profile
@remcoder
remcoder / toy-attiny-leds.ino
Created June 12, 2016 22:35
My son's 'roadblock with lights' toy broke. So decided to fix it and while at it I though to myself, why not spice it up a little bit by adding a micro to it?
#include <avr/sleep.h>
// Utility macros
#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC (before power-off)
#define adc_enable() (ADCSRA |= (1<<ADEN)) // re-enable ADC
const int ledPin1 = 1;
const int ledPin2 = 2;
@remcoder
remcoder / toy-attiny-leds.ino
Created June 12, 2016 22:35
My son's 'roadblock with lights' toy broke. So decided to fix it and while at it I though to myself, why not spice it up a little bit by adding a micro to it?
#include <avr/sleep.h>
// Utility macros
#define adc_disable() (ADCSRA &= ~(1<<ADEN)) // disable ADC (before power-off)
#define adc_enable() (ADCSRA |= (1<<ADEN)) // re-enable ADC
const int ledPin1 = 1;
const int ledPin2 = 2;
### Keybase proof
I hereby claim:
* I am remcoder on github.
* I am remcoder (https://keybase.io/remcoder) on keybase.
* I have a public key ASBDlmmbx10FUv-0UQt1gbgecJ-rPFYJbTQdNGCm_KpH5wo
To claim this, I am signing this object:
let prevGCmd = null;
const previewCode = gcode
.split('\n')
.map((i) => {
const line = i.trim();
let result = line;
if (line.startsWith('G20')) { // keep as is
return result;
}
let prevGCmd = null;
const previewCode = gcode
.split('\n')
.map((i) => {
const line = i.trim();
let result = line;
if (line.charAt(0) == 'G') {
const gCmd = new RegExp(/G\d+/g);