Skip to content

Instantly share code, notes, and snippets.

@ViliusKraujutis
ViliusKraujutis / air-sensor.ino
Created March 28, 2017 13:02
Air Sensor Arduino based air quality sensor Sensors used: DHT22 - temperature and humidity sensor MQ-2 - gas leakage detector. It is suitable for detecting H2, LPG, CH4, CO, Alcohol, Smoke or Propane MQ-3 - alcohol sensor is suitable for detecting alcohol concentration on your breath, just like your common breathalyzer. It has a high sensitivity…
/*
Air Sensor
Arduino based air quality sensor
Sensors used:
DHT22 - temperature and humidity sensor
MQ-2 - gas leakage detector. It is suitable for detecting H2, LPG, CH4, CO, Alcohol, Smoke or Propane
MQ-3 - alcohol sensor is suitable for detecting alcohol concentration on your breath, just like your common breathalyzer. It has a high sensitivity and fast response time
MQ-7 - Carbon Monoxide (CO) sensor
@ViliusKraujutis
ViliusKraujutis / compass.txt
Created May 28, 2017 13:47
Compass app for micro:bit which shows where's the NORTH. App reads compassHeading value and uses it to determine which LED to turn on. All 360 degrees are divided by 12 (ie. 30 degrees). 12 LEDs around the LED matrix are used to show the NORTH.
let Angle = 0
basic.forever(() => {
Angle = input.compassHeading()
if (345 < Angle || Angle < 15) {
basic.showLeds(`
. . # . .
. . . . .
. . . . .
. . . . .
. . . . .
@ViliusKraujutis
ViliusKraujutis / belt tensioner back
Created July 31, 2017 17:22
Anet A8 Y axis belt tensioner
$fn=20;
module holder () {
difference() {
// create rounded corners cube
rcube([20, 30, 20]);
// make a hole for the screw
translate([10, 10, 0])
screwHole();
@ViliusKraujutis
ViliusKraujutis / printer lamp handle.scad
Created August 4, 2017 05:24
Čia rankenėlė tai lemputei šalia spausdintuvo. Padariau kad viduje būtų apytuščia, su susiaurėjimais galuose; skylutes jungikliui ir magnetukui; taip pat padariau pussferės ir kūbiuko išėmimą lemputės galiukui.
$fn=60;
module lampHandle() {
difference() {
cylinder(d=35, h = 100);
translate([0,0,84]){
bulbSpace();
}
holoInside();
buttonHole();
@ViliusKraujutis
ViliusKraujutis / MainActivity.java
Created August 16, 2017 06:28
Use RxJava to detect changes
package lt.andro.learnrxjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextUtils;
import android.widget.RadioGroup;
import android.widget.TextView;
import com.jakewharton.rxbinding2.InitialValueObservable;
@ViliusKraujutis
ViliusKraujutis / lampHolder.scad
Created September 1, 2017 21:08
A holder for table lamp to fit on the corner of IKEA table
$fn=60;
holeH=37;
holeD=12.5;
h=40;
module lampHolder() {
difference() {
holderBody();
tableSpace();