Design a site like this with WordPress.com
Get started

Fusion or Not – update – Pcomp Week13

Things we have finished last week:

  • Fabrication
  • Arduino code and the circuit
  • P5 sketch code – A bit of fine tuning needed to be done.
  • Process to do projection but haven’t implemented yet.

Fabrication

We spent most of the time in fabrication. I originally wanted to make a box out of plywood using wood glue, however, the base is 17” by 22” which is larger than the laser cutter we have. So I went to Makerspace to use the big one. Yet, it was giving me some trouble so that one bottom is smaller than the bottom we wanted.

Also, the original design of the box is adapted from the website that helps making a box easier with slots. However, it makes glueing them together very time consuming and painful.

Therefore, I used band saw to cut the slots to make the border of the box straight line rather than rigged. Shannel and I got several L brackets to stable every piece of wood instead of the wood glue. It is sturdier for our box.

We discarded the design since it is hard for us to glue them especially with the bottom panel. I then cut them with the bend saw and and made sure the border of each panel is smooth and straight.

For the top of the box, we used two pieces of acrylic sheet. Given the size of the laser cutter on the floor. We decided to make two pieces rather than one for easier access to debug if there are any wiring issues in the future.

For the larger acrylic sheet, we engraved the outline of the circles so that we can find the place to glue the acrylic rod in.

I also designed the holes to make sure the ultrasonic distance sensor have enough space to detect. Since if the sensor is covered with anything, it won’t detect the hand movement.

For the smaller acrylic sheet, I designed two holes that fit the big push button and the encoder. For the QR code, we struggled to experiment on the acrylic sheet. We used the black marker and dry erase pen on top of the engraved QR code on the transparent acrylic sheet. It didn’t work on the phone. We then had to give it up and engrave on the piece of wood and then put it on top of the acrylic sheet. It is not optimal but it is still aesthetically pleasing.

Problems

Some problems we encountered during fabrication include the support for the ultrasonic sensors and the support for both acrylic sheets.

For the support for the sensors, I originally measured the distance between the sensors and laser cutted a piece of square to make a stand to hold it. Although the tiny stand will hold the sensor, it is not as stable as I wanted and it is not aesthetically pleasing since you can see the square from above through the transparent acrylic sheet.

Therefore, I redesigned the stand as below so that when you see from above through the acrylic sheet and won’t find it ugly.

I was having trouble securing the encoder since the hole is a bit smaller from the laser cut design. Therefore, I used a drill to widen it. I was quite scared at first but then I overcame the fear and increased the diameter of the hole. Now the encoder is secured with the 3D printed knob on top of it.

To be finished………

Arduino Code Here

I worked on the Arduino code. The goal is when the pushbutton is pressed once, it starts the game. When it is pushed twice, it starts the Indian layer; third, starts the Chinese layer; last, ends the game.

P5 sketch hERE

Shannel worked on code in terms of welcomeScreen, GameOverScreen, and checking the ingredients in the user input as well as the right ingredients. I worked on the part where the actual game happens. When user selects ingredients from the bowls, they will move to the big bowl.

Combining the code

Before combining the code, Shannel created a class of bowls while I had a class of Circles. Since some of their functions overlap, I then combined the code to make sure the ingredients are displayed in the position of the bowls. I then went to Aidan’s office hour and figured out how to assign the name of the ingredient to the object of the bowl.

Creating objects in an array

I made each image into objects with assigned name. So for the use ingredients array, the names can be registered to compare with the right ingredient list.

It was hard to warp my head around the concept but later, as more practices, I became very familiar with it.

Serial communication reading the data from arduino

I would not be able to receive the data at first since it only reads the data once. and I asked around about the possibility of doing serial output from arduino to p5 and p5 to arduino. But it becomes too complicated therefore, I stuck with the arduino and managed to read all the strings and had several conditional statements to call each function needed in p5.

This is when serial communication of the sensors are working properly with p5 sketch.

In terms of p5 sketch, shannel and I worked separately. She managed to have several ingredients for the both Indian and Chinese cuisines and combined our code.

There was a period of time where I was working on Arduino code and she was struggling in the p5 sketched. Therefore, I helped out and started combining the code.

There was a period of time where I was working on Arduino code and she was struggling in the p5 sketched. Therefore, I helped out and started combining the code.

It was such a long process to combine the code since there are so many details that could be easily overlooked.

Mind the details

For the serial communication, I made sure each line of serial.println() from Arduino is transferred and translated into the p5.

For some code, I have to make sure there is one function for the Indian Cuisine and another one for the Indian Cuisine since there are some trivial differences that don’t allow to be put in a universal function. For instance, the function below shows that I have to use the variable of userIngredientsChinese and layerName to show the user ingredients for the Chinese cuisine. Now looking back, I may create a universal code for both of the cuisine to make the lines shorter.

Projection

We tried to do projection on Monday morning. Thanks for Jake’s help, we got to secure the projector on the ceiling rod. However, when we tried to use the html link of our sketch, Syphon and Madmapper, the Syphon software doesn’t allow us to put the link in. So we tentatively gave up on that and will resolve the issue in the upcoming week.

Conclusion

I feel this week with the Thanksgiving break in between has allowed us to accomplish tons of work. I am proud of our progress and have more appreciation towards simple games around me. It takes lots of logic, efforts, and time to make a game that is user-oriented, and brings a smooth user-experience.

Advertisement

Published by Yiting Liu

NYU ITP '21

One thought on “Fusion or Not – update – Pcomp Week13

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: