Physical Computing with Unity

Tinkering with electronics

A talk by Ciro Durán | @chiguire

This talk has speaker notes, press 's' to reveal them.

Hi, I'm Ciro

You can pronounce that as the number zero, go ahead, that's fine.

I work in the games industry, doing lots of stuff.

Today's topic: Physical Computing

Computing and electronics are separate worlds

Physical computing bridges that gap

Who's doing this kind of thing?

Cirque du Soleil


Taken from kent_caldwell's instagram

Simone Giertz


See her videos

Robin Baumgarter


Taken from his website

NIME community


Taken from NIME conference video.

Things I've done


A Consensual Hallucination (as collaborator)

Things I've done


Lilibeth's Parade

What will we use?

  • Raspberry Pi
  • Electronic prototyping boards
  • Our own PCs

Raspberry Pi

  • A 30£ credit card sized computer
  • ARM processor
  • Decent GPU
  • 1GB RAM
  • USB ports
  • GPIO port
  • Camera and display ports

There are other models of the Pi

  • Pi Zero (and Pi Zero W)
  • Raspberry Pi 2
  • Compute Module IO Board
  • And also accesories (called HATs)

Can you run a game made with Unity for the Raspberry Pi?

Not officially. But this seems an interesting alternative!

Electronic prototyping boards

Arduino

Adafruit Feather

What can we sense with electronics?

  • Capacitance
  • Light
  • Colour
  • Sound
  • Proximity
  • Temperature
  • Humidity

An example of an Arduino sketch


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}
						

Another example of an Arduino sketch


// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  delay(1);        // delay in between reads for stability
}
						

So where does Unity come into play?

  • We can use the Serial port from .NET to communicate with the Arduino
  • We can also use the Arduino as a Joystick! (HID)
  • Or we could use it as a MIDI interface (it could require extra costs)

Setting it up

We can use the Serial port from .NET to communicate with the Arduino.

ArdUnity could make it easier

Why bother with all this?

We still need something

Questions

Thanks a lot!

You can find these slides at http://www.ciroduran.com/talks/physicalcomputing2017.

Email me at ciro.duran@gmail.com.

See speaker notes for references.