top of page
  • Writer's pictureMelina Fourtune

Workshop 1 - Arduino

Updated: May 29, 2019

3C - The green LED blinks twice as fast as the yellow one



4C - One LED slowly fades in and the other fades out at the same time

On this exercise the result isn't obvious because the green LED is not as bright as the yellow one, but if you focus on each LED individually you can see that the green one starts each 'cycle' off and increases while the yellow one starts bright and decreases.



6C - Same exercise but controlled by a potmeter (instead of a time loop)

Again, it looks better if you focus on each LED individually.



7 - The LEDs should now fade according to the amount of light that the LDR perceives

The exercise did not mention whether the LEDs should become brighter or darker when they receive light so I used the ()map function to have one LED increase while the other decreased. The LEDs in the video are purposefully out of focus so you can see the light change better.



8 - Understand two variables resistors by experimenting with two LDRs

In this situation (with two Light Dependent Resistors), R1 acts as a 'normal' light sensor as it blocks the voltage in low light and lets it through in high light.

R2 on the other hand does the opposite. In dark environments its resistance value increase but because of the voltage formula, this actually increases the final voltage.

When both sensors are used together, they cancel each other and barely add variation to the voltage (or intensity of the LED).



9B - Using Processing to use the sensor value in an interesting way

For this I initially wanted to make a square in the center of the screen that would increase or decrease in size based on the potmeter (like the circle in the example) but I accidentally swapped two corners of my quadrilaterals and it ended up looking like a bowtie. I thought it looked cool as is so I left it liked that.



10F - The LED lights up when one button is pressed, but not both

Here I used 'if' statements inside 'if' statements so that when a button is pressed the light turns on, then if a second one is pressed it turns of.



11B - Write the code in a way that the servo will move in an interesting way

For this exercise I decided to make the servo dance in a quite basic pattern (see video).



12B - One button should move the servo clockwise and the other counter-clockwise




13B - The code plays a creative melody

Turn the sound on for this video. You will hear the 'Mamma mia' chorus.


The code for this one is:

tone(speakerPin, 330, 200); delay(250);

tone(speakerPin, 294, 200); delay(250);

tone(speakerPin, 330, 200); delay(250);

tone(speakerPin, 294, 200); delay(500);

tone(speakerPin, 294, 200); delay(250);

tone(speakerPin, 294, 200); delay(250);

tone(speakerPin, 330, 200); delay(250);

tone(speakerPin, 370, 200); delay(250);

tone(speakerPin, 330, 500); delay(1000);

tone(speakerPin, 330, 200); delay(500);

tone(speakerPin, 294, 200); delay(1000);

tone(speakerPin, 392, 200); delay(500);

tone(speakerPin, 392, 200); delay(250);

tone(speakerPin, 392, 200); delay(250);

tone(speakerPin, 392, 200); delay(250);

tone(speakerPin, 370, 200); delay(250);

tone(speakerPin, 294, 200); delay(2000);



60 views0 comments

Recent Posts

See All
bottom of page