top of page

Week 4

Almost half way done and we're on the right track!

​

This week I dug into the world of programming even more. I programmed the touch board from Bare conductive company and connected the arduino to unity with some sensors. Rania let me lend her touch board that she used for her project Exhibition in year one and I had a few arduinos lying around at home to work with.

​

Because of my previous experience with connecting arduino to unity I knew what to do and how to handle. I use a potentiometer and 2 distance sensors to control the gameObject in Unity. With this I can move the object on the X and Y axis and scale the object with the potentiometer. The programming for this was easy peasy and got it done in a few hours. Below there is a link to a YouTube video that shows the final result of this.

 

https://youtu.be/Ni0lL64kT1o

 

After this I started doing some research on the code for the touch board. The next day I worked on discovering the code, how it worked and getting to run the basic commands. This was really easy to do because these codes were already writen and you could insert them into the Arduino software as a plugin.

Later that day, Rania send me a link on how to use the touch board and its conductive paint to use it as a distance sensor. Because Rania didn't had any conductive paint left from her last project I used a piece of copper to emulate the idea of conductive paint.

The easiest part was done when I managed to get the touch board to work as a proximity sensor but then the difficult part came.

 

For the installation to work we want it to interact I needed to print the data I got from the touch board into Arduino using the Serial code. The first problem I had is that it only printed digital data and I needed to have analog data. After a bit of trial and error I managed to show only the analog data into the serial monitor.

When I was done doing this, I needed to send the printed data to processing. This was done by calling out a datastream function. I need to different data pieces and thought that the best way to do this is to send a string to processing with the 2 analog datas. I had some troubles letting them appear in processing because there was no code online that showed me how it was done. The only codes I could find were codes on sending Arduino motherboard data to Processing.

​

When I finally managed to send the data to processing I came to another problem and that was sending it to Unity. Normaly it is pretty easy but because I am sending a String instead of an int or a float it was quite difficult.

I asked Boris to help me with this and together we solved the problem.

 

The last part was to show the data that I send to Unity in the Debug.Log to see if I still get the desired data. I loged it and it showed me the data I needed. The last problem that I had to face was to convert the String data that I got to 2 different Int. While Boris was still sitting next to me and looking what I was doing he told me to search for the "Split" function. This makes 2 (or more) sepperate array variables from a String. 

​

In this week I have never learned so much about programming in all sorts of languages and although it was hard to do finishing this gave me a big positive vibe to use in the last 5 weeks!

bottom of page