Interactive installation developed with Touchdesigner and Arduino
- 1 Single-board microcontroller
- 1 Magnetic contact switch
❗ The following configuration is meant for Windows OS.
Follow this steps to set the machine IP:
- Connect the ethernet cable
- On windows go to
Settings>Network & Internet>Ethernet - Select Edit in the IP configuration section
- In the
IP addressfield put the following:
10.10.40.204
- In the
Subnet maskfield put the following:
255.255.255.0
Follow this steps to make the Arduino read the magnetic sensor already mounted on the installation.
- Set up the Arduino circuit:
This circuit is really simple, since the sensor and the cables are already provided. The only things to do are to connect the GROUND and the pin number 4.
- Connect Arduino to the computer
- Open Arduino IDE
- In the Arduino IDE go to
File>Openand then selectroot>arduino>sketch.ino - Select the Arduino UNO connected to the computer from the dropdown menu above.
💡 Take note of the number of the COM to which Arduino is connected. You will need it later in the Touchdesigner project configuration
- Select
Uploadto upload the sketch to the Arduino
Now you can launch the touchdesigner project. You can find it in root > main.toe.
It will already open in perform mode.
- Use this shortcut to open the
Debug and Settings menu:
CTRL + SHIFT + .
- Navigate to General Settings
- In the
Server IPfield put the following:
10.10.40.220
- In the
NocoDB Portfield put the following:
8888
- In the
NocoDB Table IDfield put the following:
op('NocoDB_Table_IDs')['ServerExplora',1]
- In the
NocoDB Tokenfield put the following:
op('NocoDB_Tokens')['ServerExplora',1]
❗
Those two last fields use this expression to reference two components inside the touchdesigner network that store the reference and the token of the database. Turn on manually the expression checbox (turquese one below the field) if it does not turn on automatically.
- Now navigate to
Game Settings - In the
Portfield put the COM to which the Arduino is connected by selecting from its dropdown menu - Set to
SourceIndexfield to 0 to make it read the Arduino signal.
- Use again the following shortcut to close the
Debug and Settings menu:
CTRL + SHIFT + .
Now the project is all set up and ready to work. It already comes with a preset of parameter but they are all editable.
It is possible to check if the arduino is reading correctly the sensor signal by opening Tools > Serial Monitor.
It will open a terminal that expose the signal from the sensor.
If the sensor is not triggered sends 0, else it sends 1.
This specific sensor simulates the pedaling of a bike, so depending on the speed of the cycle it should send a batch of 0s, then a 1 and then repeat. If everything works there the 0s batch should get smaller while increasing the cycling speed.
Use the same shortcut as before to open Debug and Settings menu:
CTRL + SHIFT + .
Navigate to Database.
In this panel you can verify the correct communication between the touchdesigner project and the database.
The panel is divided in 3 sections:
- The command and input section
- The Terminal
- The Database data (contextual to the selected user)
Here a list of the possible operations and outputs.
Test DB Connectionwill output in the console a successfull or unsuccessfull message, depending on the availability of an answer from the database.
User Codeis an input field where to write manually the number code of any user. This user code written in this field will be the reference for all the entries below.
Fieldallows to select one or more columns from the database related to the user written in theUser Codefield.*selects all the data for a user.Get User Dataif pressed outputs the data selected in Field, for the user written in theUser Codefield. The ouput is visible in the Database data on the right.
Fieldallows to select one or more columns from the database related to the user written in theUser Codefield.*selects all the data for a user.New valueis an inout field where to write the amount of currency to be overwritten in the selected field inField.Update User Dataupdates the selected column with the new value.
Fieldallows to select one or more columns from the database related to the user written in theUser Code field.*selects all the data for a user.Value to Addselects the amount of currency to be added in the field selected in Field.Add Valueadds the amount selected inValue to Addto the selected field inFields.
Get Balanceif pressed outputs in the terminal the currenct amount of money of the user. The amount is the result of the all the fields that make the user earn currency minus the field that make the user spend money
If you want to verify the correct running of the project, without setting the
Sensor reading go to Game settings.
The SourceIndex field has 3 modes depending on the index.
0reads the sensor1displays a button on screen. If pressed, simulates only 1 pedaling input.2display a slider on screen. If moved it allows to select a specific point in the game run.
⚠ It is discouraged to edit first-hand the network. You can always edit the main parameters from
Game settings
To exit from perform mode and edit the network use this shortcut:
SHIFT + ESC
As said before it will be possible to edit some parameters that change the game experience for the user, such as speed or amount of money earned.
⚠ The parameters are now set for an optimal game experience. Is recommended to make only very small changes to the parameters.
To edit these parameters follow this steps:
- Use the same shortcut as before to open
Debug and Settings menu:
CTRL + SHIFT + .
- Navigate to
Game settings. Here you can edit the parameters descripted below:Delivery activation distanceis the radius inside which the user can successfully deliver. Higher values means an easier game experience.Default 10Delivery activation timeis the time the user has to wait for correctly deliver an item. Smaller values means an easier game experience.Default 1.5Tassesets the amount of currency for every successfull deliver that will be added the Tasse database column.Default 1Guadagno consegnasets the amount of currency for every successfull deliver that will be added to the Corriere database column.Default 10Importo multasets the amount of currency that will be subtracted to theGuadagno consegnaif the user commits a violation.Default 2Pedal impulse Multsets the multiplier of the force of every pedal input.Default 1Deceleration factorsets the resistence to every pedal input. Greater values means more resistence and a shorter pedaling sprint.Default 0.01Max velocitysets the force of every pedal input.Default 0.03
The other parameters are described in Getting started and Debug.





