Monday, May 3, 2010

Tasks. Second lot. Write answers into your blog.

13) Get one to blink mostly on and the other is mostly off. "Mostly on" means it's on all the time except for a little flash off about once a second.
14) Like 13 but the LEDs are reversed. That is, the one that mostly on is now mostly off.
15) You're now up to task 15 and it's time get get your tasks marked. Send an email to peter.brook@op.ac.nz saying you've finished up to task 15 and send a link to your blog.
16) Get one led to blink twice then the other one to blink once then repeat forever.
17) Write a for-loop with counter variable i. Get one led to blink 5 times, using the for-loop, then the other to blink once. Repeat forever.
18) Like 17 but i can be any value. Try different ones. Later we can input this value from the keyboard.
19) Write a program to get one led to increase its rate of blinking from 100ms to1sec.
20) Same as 19 but this time ramp up the rate from 10ms to 1 sec then back down again.
21) Write a program to output one led blinking at rate of 200ms that outputs the word "blink" to the screen each time it comes on.
22) Same as 21 but this time use two leds of different colours and output the colour of the led to the screen each time it goes on. So you should see eg. "red yellow red yellow ..."
23) http://wwww.wikieducator.org/User:Peterb/HowManyArduinos0 put at least one Arduino variety, like Freeduino, into this wiki with a screen shot and put a link and a comment back into your blog so that it can be verified.
24) Go into the ladyada site and look at http://www.ladyada.net/learn/sensors/cds.html which deals with light dependent resistors. Put a link and comment about this page in your blog. Identify your LDR from your pack. You will not be tested on the technical details of this sensor but you'll be expected to insert it into circuits and read off the changing light values.

25) Run the ladayada photocell program that's in the ladyada site, URL above. Write it up in your blog about what you did and the program.
26) Same as 26 above but make some changes to improve it. Put your changes into a comment so that it's obvious what the differences are.
28) Write a program to turn a LED on whenever the light is blocked to your LED. You will have to play around with several values.
29) Random numbers. Run the random number program in a post above. Take a screen shot of your output and put into your blog.
30) Output random numbers between 1 and 6 to simulate lots of dice throws. Again, take a screen shot.
31) Experiment with the Ladyada LDR program to see what values it gives when dark and what values it gives when light. Write a program to output "Dark" when the value you get from the LDR is below a certain value and "Light" when when it's above that value. Sample at about once per second.
32) Now split the light intensity into three regions: Dark, Medium and Bright. Out put one of these words when your LDR makes a reading.
33) Final tasks: Please email peter.brook@op.ac.nz with a link to your blog, a comment about where you got to in the tasks, your LED project and your big project. You should aim to have 90% of the tasks done.



1 comment: