Skip to content

Instantly share code, notes, and snippets.

@darkwave
darkwave / PiantaIntelligenteSummerVersion.ino
Created June 20, 2016 05:58
Moisture sensor on pin A0 and RGB LED on pins 13, 11, 10 with GND on pin 12
int rPin = 13;
int gndPin = 12;
int gPin = 11;
int bPin = 10;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
#include "Keyboard.h"
const int buttonPin = 4; // input pin for pushbutton
int previousButtonState = HIGH; // for checking the state of a pushButton
int counter = 0; // button push counter
void setup() {
// make the pushButton pin an input "pullup":
pinMode(buttonPin, INPUT_PULLUP);
// initialize control over the keyboard:
@darkwave
darkwave / edison.sbe
Created March 13, 2016 12:02
Intel IoT Hackathon entry
{
"extensionName": "WeatherCast",
"extensionPort": 12345,
"blockSpecs": [
[" ", "connect %m.sensors sensor to %m.digitalpin", "connect"],
[" ", "connect %m.analogsensors analog sensor to %m.analogpin", "connect"],
[" ", "connect %m.leds led to %m.digitalpin", "connect"],
[" ", "connect %m.actuators to %m.digitalpin", "connect"],
[" ", "Turn %m.leds led %m.onoff", "turn"],
[" ", "Buzzer %m.onoff", "buzzer"],
@darkwave
darkwave / proxy.py
Created March 12, 2016 22:42
Python proxy server to redirect calls from localhost to different address (change forward_to variable)
#!/usr/bin/python
# This is a simple port-forward / proxy, written using only the default python
# library. If you want to make a suggestion or fix something you can contact-me
# at voorloop_at_gmail.com
# Distributed over IDC(I Don't Care) license
import socket
import select
import time
import sys
@darkwave
darkwave / domus.ino
Created February 20, 2016 11:54
DOMUSino Example of bridge with Arduino YUN
#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
// Listen to the default port 5555, the Yún webserver
// will forward there all the HTTP requests you send
boolean rooms[14];
BridgeServer server;
@darkwave
darkwave / Bird.pde
Last active January 29, 2016 23:39
GGJ16
class Bird {
int frameCounter = 0;
int currentAnimation = 0;
float posX, posY;
PImage[][] animations;
int lastFrame = millis();
int fps = 12;
Bird(float posX, float posY, String baseFilename, int numberOfAnimations, int numberOfFrames) {
animations = new PImage[numberOfAnimations][numberOfFrames];
@darkwave
darkwave / Box.ino
Last active February 12, 2016 13:46
Project RobOld
#include <Bridge.h>
#include <HttpClient.h>
int lightValue;
int photoResistorPin = A0; //analog input 0
void setup() {
// Bridge takes about two seconds to start up
// it can be helpful to use the on-board LED
// as an indicator for when it has initialized
pinMode(13, OUTPUT);
@darkwave
darkwave / BonjourAndroid.pde
Created January 6, 2016 21:58
Bonjour using jmDNS on Processing Android Mode
import javax.jmdns.*;
import java.util.Map;
import java.net.InetAddress;
import java.util.Locale;
import android.net.wifi.WifiManager.MulticastLock;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiInfo;
import android.app.Fragment;
import android.content.Context;
import java.net.UnknownHostException;
@darkwave
darkwave / Bonjour.pde
Created January 6, 2016 21:56
Bonjour using jmDNS on Processing
import javax.jmdns.*;
import java.util.*;
import java.net.*;
JmDNS jmdns;
static String message = "";
void setup() {
size(640, 480);
InetAddress ipAddress = getLocalIpAddress();
@darkwave
darkwave / GameSprite.pde
Created January 1, 2016 13:21
Sprite collision using boundaries intersection and (then) bitmask with Processing 3
Element player, enemy;
void setup() {
fullScreen();
player = new Element("animal.gif", 50, 50);
enemy = new Element("animal.gif", 40, 40, -175, -309);
stroke(#ff00ff);
}