I think the song is an old one for Abdel-haleem Hafez.
I wasn't able to create my own tones at the beginning of the week but then I understood how.
My assignment idea for this week is to connect a servo motor with a potentiometer and PIR to control the motor manually or when someone moves in front of the sensor, also connected to white lighted led so that it lights when the motor moves.
At the same time, connected to the ultrasonic sensor is an RGB LED that lights up with different colors according to how far an object stands in front of the sensor.
This idea mainly is an application for my final project's idea.
As the origami pieces open the star will be lighted-up with a white color (White LED) and when someone gets closer the smaller triagles are lighted up with different colors according to the distance between the person and the object (RGB led).
Was inspired by the extra excercise that was explained during our end of week session.
First, I used the repeat (control)...to move the motor three times so that the origami opens and the white light shows up.
I used an "if" function to read digit 8 that was connected to PIR sensor...rotate servo on pin 9 to a different angle else it will rotate according to the potentiometer that was connected to A5 in the Arduino.
Then repeat the next functions; reading pin 8 (PIR sensor) if the PIR is working pin 7 will be high (white led will light up) for 2 seconds and then dims....read the ultrasonic sensor waves if it is within a range of 2-150 make the red color high while the blue and green low and if it is between 151-250 make the blue high while the red and green low, finally if the range is between a 250-315 make the green high while the red and blue low.
Yes, I asked if we can combine exercise 1 & 2 together and have two functions in one circuit.
And it inspired me through this week's assignment.
Actually, I had a challenge that I couldn't overcome...all the components didn't work together it was either the motor was revolving or the RGB changing colors I couldn't manage to have both of them working together.
I can use all the applications of this week combined together to form the functionality of my project, actually when I tried to move the piece using a servo and a thread it didn't work that's why I had realized that I should visit the lab and try to cut a small module to try the motor mechanism on to figure out how does it work
How to make objects smart + Interactive =)