Dancing Lasers Test: Perilous Frequency (Project 1)


Connect the Arduino, photoelectric sensor, and laser using a breadboard. Power the setup with 5V. The photoelectric sensor converts the received signals into 0 and 1 and sends them to the Arduino. The Arduino outputs the digital 0/1 via serial communication, which is then input into Pure Data (using the comport object). In Pure Data, the 0/1 values control a toggle switch, which is further used to manipulate sound changes.

Here is the code demo:Arduino Output Coding

Test Serial Communication:

Arduino:

Pure Data:

Pure Data Output Coding:

Encountered Issues:

  1. Serial communication error: Even after verifying all steps, serial communication reported an error. (Resolved)
  2. Data mismatch in Pure Data: The Arduino outputs digital values as 0 and 1, but Pure Data’s 'list fromsymbol‘ prints them as symbol values. The ‘select‘ object cannot recognize these symbols. It requires converting them into pure numbers, identifying the changing values from the printed numbers, and then using ‘select‘.
  3. Continuous output of 0 and 1: The continuous stream of 0s and 1s from the Arduino results in the toggle in Pure Data repeatedly turning on and off. This behavior limits the creative possibilities for sound selection in Pure Data (as I am not very proficient in controlling Pure Data).

Test Arduino Code Video:

声音测试视频:


Leave a Reply

Your email address will not be published. Required fields are marked *