You are on page 1of 1

Computer Science 305

Arduino Lab 5: Bouncy Ball


Name: __________________________ Signature _____________________________ Learning objective: In this part !e !ill learn ho! to communicate bet!een t!o programs "one running on the Arduino and one on your laptop#$

1. Download and install the programming language Processing "%0 pts#

"http:&&!!!$processing$org&do!nload# 'emo one o( the e)amples included in the do!nload "(or e)ample 3' camera *o+e,ye#$ Signed o((: _______________________________________

2. *o+e a ball !ith a photoresistor " 30 pts#


Load ,)amples - Libraries - Serial - SerialCall.esponse Hardware: construct the light sensor circuit described in lab / Software: 0he bottom portion o( the code "commented out# is (or the Arduino$ Copy it to a ne! Arduino code !indo!$ 1or no! you !ill not need to alter the 2rocessing Code but you !ill need to edit the Arduino code$ 0he current code assumes three sensors but so (ar you only ha+e 3$ 0he current code Serial$prints those three +alues$ 4ou need to change the code so that you do only one analog.ead and output constants as the other t!o +alues$ 1or e)ample I used (irstSensor as my photoresistor analog.ead and set secondSensor as 300 and the third as %00$ Compile and upload the Arduino code and then run the 2rocessing code$ 4ou should be able to control the ball using the photosensor$ Signed o((: _____________________________________ 3$ "%5 pts# Add a potentiometer to the hard!are and change the so(t!are so you can control the ) and y o( the ball$ Signed o((: _____________________________________ /$ "%/ pts# Add a button to the hard!are and ha+e it do something interesting$ 1or e)ample change the si6e or color o( the ball$ Instructor sign o((: _____________________________________

5. "%0 pts# ,)tend the pro7ect in an interesting !ay$ 1or e)ample e)tending the can+as and
ha+ing the ball mo+e throughout the entire space !ould be !orth perhaps 5 points or so$ Adding more sensors "may need to borro! (rom teammates# and controlling a second ball !ould be !orth 30$ 0hese are 7ust e)amples$ Instructor sign o((: ______________________________________
CPSC305-Arduino Lab 5 1/1

You might also like