Lab 3: Processing
- Due 11 Apr 2022 by 23:59
- Points 1
- Submitting a text entry box, a media recording, or a file upload
- Available 4 Apr 2022 at 9:00 - 25 Jul 2022 at 23:59
In this lab you will connect the Arduino with Processing over serial communication (USB). This is a very powerful combination as you can let the Arduino handle custom hardware and make, e.g., visualisations, games, GUIs, and complex programs in the Processing environment. Processing was originally made for artists and should be quite easy to get into. Don't forget to browse online if you have problems and/or want to do something specific and don't have any idea on how to start. Looking for Processing on Youtube may also give you some inspiration. The teachers can (and are eager to) help you solve concrete struggles once you have already been proactive on your side.
0. Preparatory tasks (to be completed before the lab session):
- Download the Processing IDE Links to an external site..
-
Have at hand the tutorials
Links to an external site.and the examples
Links to an external site. page and skim through them (not just for inspiration, also to consult them later when you want to implement specific interactions).
- Read our Introduction to Processing Download Introduction to Processing and try out those simple functions.
- Read this tutorial Links to an external site. on how to connect Arduino and Processing.
-
- The setting up of the serial communication will depend on the OS you are using and might not match the tutorial's code (also, remember to choose the port correctly in both the Arduino and the Processing sketches).
- You shouldn't be using the Processing application at the same time as the Arduino serial monitor, otherwise you will get an error since the port will be busy!
- It's going to be easier for you to troubleshoot if you disconnect everything from the Arduino, except the USB cable.
- The tutorial has a nice section on "Tips and tricks".
1. Lab procedure (you can start this before the lab session):
-
Use your choice of sensors, buttons, etc., and make your own interactive visualisation OR mini game in Processing. The goal is to control the Processing application from your sensors and buttons (although buttons can be boring...). You can create something beautiful, something playful, etc.: It does not need to solve any real-world problem. However, even if it's not serving a purpose, it still has to be interactive.
Your code should not be a copy of an existing example (simply changing colours or shape sizes is still a copy). Also, remember the code of honour of the EECS school, and always credit your inspiration sources (e.g., as a comment with a link on your code).
Think about this lab as a creative exploration. If you wanted to do something extra and you didn't succeed by the deadline, go ahead and document your ideas anyway (you can also sketch them and not just describe them with words!), perhaps the teachers can help you implement this for the final project later.
Advice: Emphasise the role of your sensors in influencing the visualisation, and don't spend too long in an overly-complex logic in Processing that doesn't depend on the sensors. If you're in doubt on whether you're focusing too much on the "non-sensor-based" Processing side, don't hesitate in asking the teachers before committing too much time. -
Document your interactive system in a short video and upload it. Follow this checklist (as in each lab, we will enforce this when grading):
- Show the circuit. Briefly explain the wiring and the components in use (especially the sensors) and the communication protocols.
- Walk briefly through the code, explaining how it works (especially how the sensor is read and how the reading is used in the visualisation/game).
- Show the interaction in action. Make sure that we can see the computer screen, the circuit with the sensors, and you interacting with them simultaneously.
- Upload the code.
- You can write an optional, brief piece of feedback explaining if you struggled with anything in the description of this assignment (not its resolution) and your suggestion for improvement. You can upload this together with the other files, or as a submission comment.
- You can also upload your idea sketches, if you want additional feedback from the teachers.
2. Lab session:
During the lab session, the teachers will be available to help you if you have got stuck with the assignment.
For those connecting remotely, we will use a queuing system to make it fair and organised. So, if you have trouble completing the lab AND after looking for info online you are still stuck, OR towards the end of the session you simply want to show us what you did, then you sign up here: https://queue.csc.kth.se/ (look for DM1588).
Please indicate there your group number, your Zoom meeting link (make sure it is not password protected) and whether you require help or just want to show us your nice results (this is optional). When it is your turn, a teacher will join your Zoom meeting and will label your group in the queue as being helped.
We also have physical classrooms assigned to us along the course (you can see this on the official schedule in KTH Social). We will do our best to have at least one teacher physically there (maximum 2 teachers) to help those who really want in-person assistance. This will depend on how we assess the risks regarding the pandemic, which may change from one week to another, so please let's be patient with each other and respect social distance, etc. You can also use the classrooms during the assigned slots if you need a space to gather with your group, even if you don't need the teachers' assistance.