We have a new forum for discussing Fugio ideas and issues. It’s a bit quiet so far so do post up your thoughts and questions!
This Sunday (May 7th) I’ll be taking part in the Imperial College Festival, showing our Fugio based virtual reality experience that explores whole genome sequencing of bacteria. Come along and say hello.
This new version, previously shown at Oxford’s Museum of History of Science (pictured), features smells that are blown towards the participant via motors with 3D printed fans at points synchronised to the audio narrative; their speed controlled by a Fugio timeline sending serial messages to an Arduino with a motor shield.
In other news, I asked the Fugio Users Group whether they were running 32 bit or 64 bit Windows. The results were 100% 64 bit! Until now I’ve just been building Fugio on Windows as a 32 bit application, but I’d like to support 64 bit too, so I put the basics in place, and also looked at cmake as an alternative to finding different libraries, the results of which are all on GitHub.
I’ll be in Amsterdam next week, so you can look forward to a “Fugio vrijdag” update.
Today we have two new plugins that enable Fugio to talk to hardware that uses a serial port interface, which includes the Arduino range of open source hardware (like the Arduino Uno above), which means that we can control LED lights, motors, servos, and use sensors for touch, magnetism, temperature, and many more!
The serial plugin handles the raw data communication between the Arduino and Fugio, and can be used to implement any kind of custom protocol between the two, but we can go one further and use the rather nice Firmata plugin to talk directly to the Arduino pins without writing any Arduino code at all.
I haven’t had time to do a tutorial video (yet), but here’s some pointers to get you started:
Setting up a Serial Port
In the new Devices menu, choose Serial Ports
Add an entry for your Arduino. Make sure you choose the right port, and set the baud rate (the speed the serial port will work at) to 57600 (bits per second)
Remember to press the Enable button for the entry you’ve just added
Reading from the Arduino (without Firmata)
Upload the following code to your Arduino:
void setup()
{
Serial.begin( 57600 );
while( !Serial )
{
// wait for serial port to connect.
}
}
void loop()
{
Serial.println( "Hello, World!" );
delay(1000); // wait for a second
}
Create the following:
And use the following Lua program:
fugio = require "fugio"
PinInputStrings = fugio.input( "Strings" )
function main()
local Strings = PinInputStrings:get()
for i = 1,#Strings do
fugio.log( i .. ": " .. Strings[ i ] )
end
end
Add a Serial Input node, a Firmata node, and a Serial Output node
Connect the Serial input and Serial output to the Firmata node
Connect a button to the Reset pin
If everything is connected and configured properly, you should see the pins appearing on the Firmata node. Check the logger window for additional messages.
If this doesn’t happen first time, you may need to close the patch and reload it.
At this point you should be able to read and write to the Arduino pins!
Click the Edit Pins button to configure pins for inputs (digital INPUT (true/false) and ANALOG input (0-1023)), and outputs (digital OUTPUT (true/false), and PWM mode is supported):