Skip to content

Instantly share code, notes, and snippets.

View WillFK's full-sized avatar

William Fernandes Koehler WillFK

View GitHub Profile
let data = {
"temple" : {
"templeLeft": {
"random" : 0
},
"templeRight": 42
}
}
//find a property called "random"
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
import * as fs from "fs"
function parse(x) {
return x.replace(".", ",")
}
await fs.readFile("./stuff.txt", "utf8", async (error, data) => {
if (error) {
console.log("unable to load input.txt")
git branch | grep -v "master" | xargs git branch -D
logaddress_add 1
/**
* Integration between PIR, Ultrasonic sensor and motor. plus LEDs!
*
* PIR awakes Sonar; Sonar triggers Vibrators and NeoLED
*
*/
#include <Adafruit_NeoPixel.h>
// PIR
const int PIN_PIR_INPUT = 3;
#include <Adafruit_NeoPixel.h>
#define PIN 8
#define NUM_LEDS 1
//create a NeoPixel strip
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);
int colors[] = {0, 0, 0};
int colorsInc[] = {1, 1, 1};
int colorsIndex = random(3);
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)
while True:
print "LED on"
GPIO.output(18,GPIO.HIGH)
time.sleep(1)
/**
* Integration between PIR, Ultrasonic sensor and motor. plus LEDs!
*
*/
const int PIN_PIR_INPUT = 10;
const int PIN_SONAR_TRIGGER = 6; // Input
const int PIN_SONAR_ECHO = 9; // Output
const int PIN_SONAR_SUPPLY = 9;
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52