Skip to content

Instantly share code, notes, and snippets.

View larsgrefer's full-sized avatar

Lars Grefer larsgrefer

View GitHub Profile
@larsgrefer
larsgrefer / ProgressLCD.cpp
Created March 20, 2016 20:27
Arduino LiquidCrystal Progress
#include "Arduino.h"
#include "ProgressLCD.h"
ProgressLCD::ProgressLCD(LiquidCrystal* lcd) {
this->lcd = lcd;
for(int i = 0; i < 8; i++){
zero[i] = B00000;
one[i] = B10000;
two[i] = B11000;
three[i] = B11100;
@larsgrefer
larsgrefer / git-version.gradle
Created October 28, 2015 23:07
Get your gradle version from git tags
def lastTag = 'git describe --abbrev=0 --tags'.execute([],rootProject.projectDir).text.trim()
def currentTag = 'git tag --points-at HEAD'.execute([],rootProject.projectDir).text.trim()
def tempVersion = lastTag + '-SNAPSHOT'
if(hasProperty('version') && !'unspecified'.equals(version)) {
tempVersion = version
} else if (lastTag.equals(currentTag)){
tempVersion = currentTag
}