Skip to content

Instantly share code, notes, and snippets.

View fperucic's full-sized avatar

Fran Peručić fperucic

View GitHub Profile
# -*- coding: utf-8 -*-
from collections import OrderedDict
import csv
def nl(data):
""" remove new lines """
return data.replace('\r', '').replace('\n', '')
@fperucic
fperucic / arduino_basic_button_code.cpp
Last active September 5, 2015 01:14
Arduino button click without delay. Toggle led on button up.
const int buttonPin = 10; // the pin that the pushbutton is attached to
const int ledPin = 9; // the pin that the LED is attached to
int wasClickActive = 0; // state of button click
int ledStatus = 0; // currentLedStatus
void setup() {
pinMode(buttonPin, INPUT); // initialize the button pin as a input:
pinMode(ledPin, OUTPUT); // initialize the LED as an output: