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

Dependencies:   mbed

Fork of Exercise6 by Andrew Brown

main.cpp

Committer:
drewantech
Date:
2020-02-24
Revision:
3:6875cf4af4a1
Parent:
2:20562827e8dd

File content as of revision 3:6875cf4af4a1:

#include "mbed.h"
/****************************************************************
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.

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
DigitalOut led1(D5);
DigitalOut led2(D6);
DigitalOut led3(D7);
DigitalOut led4(D8);
DigitalOut led5(D9);
DigitalOut led6(D10);
DigitalOut led7(D11);
DigitalOut led8(D12);

// this is your main function and is where the code starts good luck!
int main() {

}