Arduino
INTRODUCTION TO ARDUINO
The Arduino is like a mini computer that we can program to power and control devices such as LEDs, motion sensors, and motors. The presentation below shows the basic equipment you will use with the Arduino.
PowerPoint Presentation
CHALLENGE 1: BUILDING YOUR FIRST CIRCUIT
Build a circuit that provides power to an LED lightbulb using the Arduino, a breadboard, an LED, and a resistor. Use the worksheet below to help you.
Arduino LED Worksheet
Bonus Challenge: Replace the single bulb LED with an RGB LED which includes a red, green, and blue bulb. Remember to update the code so that you can program all three colours.
CHALLENGE 2: CREATING A MORSE CODE MACHINE
Morse code is a system of communication that involves using dots (short pulses) and dashes (long pulses) to convey a message involving letters or numbers
Using the circuit you built in Challenge 1, program the LED to communicate a short message of your choice in Morse code.
You will need to create a function for dots (short pulse) and dashes (long pulse). Then, you can use the morse code alphabet in the Arduino LED worksheet (found on page 3) to help you communicate your message.
Arduino LED Worksheet
Bonus Challenge: Add a button to your breadboard circuit. When the button is pressed, the LED should start blinking the morse code message. Remember the button will require power, grounding, and a digital pin connection.
CHALLENGE 3: USING THE SERVO MOTOR
A servo motor is a small motor that can rotate at a specific angle. To set up the motor, follow the instructions in the worksheet below.
Arduino Servo Worksheet
Bonus Challenge: Attach the servo motor to a miniature putter and use it to hit a golf ball towards a hole.
Ballistics
BALLISTICS
PowerPoint Presentation
Coding Projectile Motion
If you have experience with projectile motion then you can work on coding projectile motion via this activity:
Here is sample code for a box and a sphere colliding:
#determines whether a sphere and box intersect or not
#returns boolean
def collisionSphereAndBox(sphereObj, boxObj):
if((sphereObj.pos.x-sphereObj.radius<boxObj.pos.x+boxObj.length/2 and sphereObj.pos.x+sphereObj.radius>boxObj.pos.x-boxObj.length/2) and (sphereObj.pos.y-sphereObj.radius<boxObj.pos.y+boxObj.height/2 and sphereObj.pos.y+sphereObj.radius>boxObj.pos.y-boxObj.height/2)):
result=True
else:
result=False
return result
