Teaching Chloe C (and maybe C++) / Mbed 2 deprecated Exercise6

Dependencies:   mbed

Fork of Exercise6 by Andrew Brown

Files at this revision

API Documentation at this revision

Comitter:
drewantech
Date:
Mon Feb 24 14:53:38 2020 +0000
Parent:
2:20562827e8dd
Commit message:
Exercise 6

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Feb 24 14:06:14 2020 +0000
+++ b/main.cpp	Mon Feb 24 14:53:38 2020 +0000
@@ -1,9 +1,14 @@
 #include "mbed.h"
 /****************************************************************
-In this exercise a bit of if statment use!
+In this exercise we will now get onto a new concept called PMW (pulse wirdth modulation)
+
+this is basicly the use of fast acting digital pins to simulate analoge outputs.
 
-I would like you, whist using the function made in the prevoiuse exercise to make the yellow leds to count in binary and when the number is an odd number the red LED's 
-light up.
+for this example I would iniitally like you to play with the "wait();" function.
+The wait function can take float inputs and so can delay by fractions of a seconds
+
+write a function that turns on the led then waits a specific amount of time (the argument of the function) and then turns it off again.
+place this function only in the main.
 ***************************************************************/
 
 // these functions initializes the led pins and functions associated with them these are technically c++ but dont worry to much about this yet