sensor

Committer:
noutram
Date:
Thu Nov 09 14:24:12 2017 +0000
Revision:
0:6f9f2e93a0be
Child:
1:3250ba797c16
Library for the ELEC350/1 Practical Tasks using the FZ429ZI board

Who changed what in which revision?

UserRevisionLine numberNew contents of line
noutram 0:6f9f2e93a0be 1 #include "mbed.h"
noutram 0:6f9f2e93a0be 2 #include "sample_hardware.hpp"
noutram 0:6f9f2e93a0be 3
noutram 0:6f9f2e93a0be 4 #define RED_DONE 1
noutram 0:6f9f2e93a0be 5 #define YELLOW_DONE 2
noutram 0:6f9f2e93a0be 6
noutram 0:6f9f2e93a0be 7 //Digital outputs
noutram 0:6f9f2e93a0be 8 DigitalOut onBoardLED(LED1);
noutram 0:6f9f2e93a0be 9 DigitalOut redLED(PE_15);
noutram 0:6f9f2e93a0be 10 DigitalOut yellowLED(PB_10);
noutram 0:6f9f2e93a0be 11 DigitalOut greenLED(PB_11);
noutram 0:6f9f2e93a0be 12
noutram 0:6f9f2e93a0be 13 //Inputs
noutram 0:6f9f2e93a0be 14 DigitalIn onBoardSwitch(USER_BUTTON);
noutram 0:6f9f2e93a0be 15 DigitalIn SW1(PE_12);
noutram 0:6f9f2e93a0be 16 DigitalIn SW2(PE_14);
noutram 0:6f9f2e93a0be 17 //Serial pc(USBTX, USBRX);
noutram 0:6f9f2e93a0be 18
noutram 0:6f9f2e93a0be 19 //POWER ON SELF TEST
noutram 0:6f9f2e93a0be 20 void post()
noutram 0:6f9f2e93a0be 21 {
noutram 0:6f9f2e93a0be 22 //POWER ON TEST (POT)
noutram 0:6f9f2e93a0be 23 puts("TASK 616 - ALL LEDs should be blinking");
noutram 0:6f9f2e93a0be 24 for (unsigned int n=0; n<10; n++) {
noutram 0:6f9f2e93a0be 25 redLED = 1;
noutram 0:6f9f2e93a0be 26 yellowLED = 1;
noutram 0:6f9f2e93a0be 27 greenLED = 1;
noutram 0:6f9f2e93a0be 28 wait(0.05);
noutram 0:6f9f2e93a0be 29 redLED = 0;
noutram 0:6f9f2e93a0be 30 yellowLED = 0;
noutram 0:6f9f2e93a0be 31 greenLED = 0;
noutram 0:6f9f2e93a0be 32 wait(0.05);
noutram 0:6f9f2e93a0be 33 }
noutram 0:6f9f2e93a0be 34 }