Skip to content

ExploraMDBR/economiamo-logistica

Repository files navigation

Economiamo - Corriere

Interactive installation developed with Touchdesigner and Arduino

Softwares

Hardware

  • 1 Single-board microcontroller
  • 1 Magnetic contact switch

Getting started

Machine configuration

❗ The following configuration is meant for Windows OS.

Follow this steps to set the machine IP:

  1. Connect the ethernet cable
  2. On windows go to Settings > Network & Internet > Ethernet
  3. Select Edit in the IP configuration section

ipsettings

  1. In the IP address field put the following:
10.10.40.204
  1. In the Subnet mask field put the following:
255.255.255.0

Arduino configuration

Follow this steps to make the Arduino read the magnetic sensor already mounted on the installation.

  1. Set up the Arduino circuit:

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.

  1. Connect Arduino to the computer
  2. Open Arduino IDE
  3. In the Arduino IDE go to File > Open and then select root > arduino > sketch.ino
  4. Select the Arduino UNO connected to the computer from the dropdown menu above.

selectArduino

💡 Take note of the number of the COM to which Arduino is connected. You will need it later in the Touchdesigner project configuration

  1. Select Upload to upload the sketch to the Arduino

upload

Touchdesigner project configuration

Database communication

Now you can launch the touchdesigner project. You can find it in root > main.toe. It will already open in perform mode.

  1. Use this shortcut to open the Debug and Settings menu:
CTRL + SHIFT + . 
  1. Navigate to General Settings
  2. In the Server IP field put the following:
10.10.40.220
  1. In the NocoDB Port field put the following:
8888
  1. In the NocoDB Table ID field put the following:
op('NocoDB_Table_IDs')['ServerExplora',1]
  1. In the NocoDB Token field 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.

expression

Arduino reading

  1. Now navigate to Game Settings
  2. In the Port field put the COM to which the Arduino is connected by selecting from its dropdown menu
  3. Set to SourceIndex field to 0 to make it read the Arduino signal.

Finalizing the set up

  1. 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.

Debug

Arduino

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.

Touchdesigner

Use the same shortcut as before to open Debug and Settings menu:

CTRL + SHIFT + . 

Database communication

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:

  1. The command and input section
  2. The Terminal
  3. The Database data (contextual to the selected user)

debug

Here a list of the possible operations and outputs.

Test
  • Test DB Connection will output in the console a successfull or unsuccessfull message, depending on the availability of an answer from the database.
User Code
  • User Code is 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.
Get
  • Field allows to select one or more columns from the database related to the user written in the User Code field. * selects all the data for a user.
  • Get User Data if pressed outputs the data selected in Field, for the user written in the User Code field. The ouput is visible in the Database data on the right.
Update
  • Field allows to select one or more columns from the database related to the user written in the User Code field. * selects all the data for a user.
  • New value is an inout field where to write the amount of currency to be overwritten in the selected field in Field.
  • Update User Data updates the selected column with the new value.
Add
  • Field allows to select one or more columns from the database related to the user written in the User Code field. * selects all the data for a user.
  • Value to Add selects the amount of currency to be added in the field selected in Field.
  • Add Value adds the amount selected in Value to Add to the selected field in Fields.
Balance
  • Get Balance if 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

Project running

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.

  • 0 reads the sensor
  • 1 displays a button on screen. If pressed, simulates only 1 pedaling input.
  • 2 display a slider on screen. If moved it allows to select a specific point in the game run.

Project network

⚠ 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 

Editing the project

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:

  1. Use the same shortcut as before to open Debug and Settings menu:
CTRL + SHIFT + . 
  1. Navigate to Game settings. Here you can edit the parameters descripted below:
    • Delivery activation distance is the radius inside which the user can successfully deliver. Higher values means an easier game experience. Default 10
    • Delivery activation time is the time the user has to wait for correctly deliver an item. Smaller values means an easier game experience. Default 1.5
    • Tasse sets the amount of currency for every successfull deliver that will be added the Tasse database column. Default 1
    • Guadagno consegna sets the amount of currency for every successfull deliver that will be added to the Corriere database column. Default 10
    • Importo multa sets the amount of currency that will be subtracted to the Guadagno consegna if the user commits a violation. Default 2
    • Pedal impulse Mult sets the multiplier of the force of every pedal input. Default 1
    • Deceleration factor sets the resistence to every pedal input. Greater values means more resistence and a shorter pedaling sprint. Default 0.01
    • Max velocity sets the force of every pedal input. Default 0.03

The other parameters are described in Getting started and Debug.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •