Assignment due Nov 1

For today’s assignment we had 2 tasks. The first was to control the movement of a servo motor through processing. The second was to control the LED state using a mouseClick in processing.

Part 1

This assignment was very similar to the Dimmer example. A few modifications and you could control the servo with ease. The key step was the use of the map() function. The code is pasted below: 

Processing – 

Arduino – 

 

Part 2 

For this part, the key step was identifying whether the mouseX and mouseY values were within the correct rectangle and returning an appropriate value to the port which could then be read by the arduino. 

Processing – 

Arduino – 

 

Leave a Reply

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