Skip to content

Instantly share code, notes, and snippets.

View spitty's full-sized avatar

Maksim Logunov spitty

View GitHub Profile
/*
This Arduino sketch shows QR-code with word 'AMAZING' and a heart
in the right side of GLCD-display.
Used parts:
- Library openGLCD https://bitbucket.org/bperrybap/openglcd/wiki/Home
- example life.pde "John Conway's Game of Life for openGLCD"
Author: Maxim Logunov [email protected]
Date: 2016-12-17
*/
@spitty
spitty / arduino_qr_code.cpp
Last active December 18, 2016 21:11
Arduino IDE sketch
/*
This Arduino sketch shows QR-code with word 'AMAZING' and a heart
in the right side of GLCD-display.
Library openGLCD https://bitbucket.org/bperrybap/openglcd/wiki/Home
is used.
Author: Maxim Logunov [email protected]
Date: 2016-12-17
*/
#include <openGLCD.h>
git diff --no-prefix --ignore-space-at-eol | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" > changes.patch
# Original: https://oscarliang.com/raspberry-pi-arduino-connected-i2c/
import smbus
import time
# for RPI version 1, use "bus = smbus.SMBus(0)"
bus = smbus.SMBus(1)
# This is the address we setup in the Arduino Program
address = 0x04
// Original: https://oscarliang.com/raspberry-pi-arduino-connected-i2c/
#include <Wire.h>
#define SLAVE_ADDRESS 0x04
int number = 0;
int state = 0;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600); // start serial for output

Benchmark Report

Benchmark Regex

                      name | rank | runs |      mean |        sd | timesBaseline

-------------------------------|------|------|-----------|-----------|-------------- proposed function | 1 | 100 | 3.124e-05 | 0.0001394 | 1.0 proposed function long | 2 | 100 | 3.994e-05 | 7.532e-06 | 1.27873607083

import benchmark
import re
class Benchmark_Regex(benchmark.Benchmark):
each = 100 # allows for differing number of runs
def setUp(self):
# Only using setUp in order to subclass later