Skip to content

Instantly share code, notes, and snippets.

View bjlanza's full-sized avatar

Borja Javier Lanza López bjlanza

View GitHub Profile
// Wire Master Writer
// by Nicholas Zambetti <http://www.zambetti.com>
// Demonstrates use of the Wire library
// Writes data to an I2C/TWI slave device
// Refer to the "Wire Slave Receiver" example for use with this
// Created 29 March 2006
// This example code is in the public domain.
// Wire Slave Receiver
// by Nicholas Zambetti <http://www.zambetti.com>
// Demonstrates use of the Wire library
// Receives data as an I2C/TWI slave device
// Refer to the "Wire Master Writer" example for use with this
// Created 29 March 2006
// This example code is in the public domain.
@bjlanza
bjlanza / rfid_spark_final.ino
Created July 4, 2016 04:13
Read rfid tags with an SM130 Sparkfun Shield and send a byte when is done
#include <SoftwareSerial.h>
SoftwareSerial rfid(3, 2);
//Prototypes
void check_for_notag(void);
void halt(void);
void parse(void);
void print_serial(void);
void read_serial(void);
@bjlanza
bjlanza / Dmxduino_Serial.ino
Created July 4, 2016 04:01
Example of If - Serial- Arduino and Dmx
/*
FabAcademy 2016 - Borja Javier Lanza Lopez
FabLab León 2016 - Instructor Nuria Robles
Serial to DmxDuino
*/
//Variables
int incomingByte;
@bjlanza
bjlanza / Serial.cs
Last active July 3, 2016 22:59
C# for Unity to try to read Serial
using UnityEngine;
using System.Collections;
using System.IO.Ports;
using System;
using System.Threading;
public class Serial : MonoBehaviour {
public SerialPort sp;
public int bytes;
@bjlanza
bjlanza / Unity Change Meshes.cs
Last active July 3, 2016 22:55
How to change meshes in and object
using UnityEngine;
using System.Collections;
using System.IO.Ports;
using System.Text;
using System.Threading;
public class changeMesh : MonoBehaviour {
public GameObject MyMainGameObject;
public GameObject[] arrayGM = new GameObject[4];
@bjlanza
bjlanza / SendOSCmsg.cpp
Last active July 3, 2016 22:56
Sending OSC messages in OpenFrameworks
//--------------------------------------------------------------
void ofApp::cambiarMatrizOSC(string layer1, string layer2, string layer3){
ofxOscMessage m;
m.setAddress("/sources/1video/clip");
m.addStringArg(layer1);
oscSender.sendMessage(m);
ofxOscMessage m1;
m1.setAddress("/sources/2video/clip");
@bjlanza
bjlanza / ReadSerial.cpp
Last active July 3, 2016 22:57
Read Serial in OpenFrameworks
void ofApp::leerSerial(){
// The serial device can throw exeptions.
try
{
// Read all bytes from the device;
uint8_t buffer[16];
while (device.available() > 0)
// Funcion
void ofApp::compararSerial(){
//3DPrint
if (mensaje[0]=='b') {
cambiarMatrizOSC("chess.jpg", "prisme.mov","mkb2.png");
//img_Selection.load("img/mkb2.png");
dmxduino.writeByte(97);