SOFT564Z Group 3 / Mbed 2 deprecated SOFT564Z_Group_3v3

Dependencies:   mbed Servo ros_lib_kinetic

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers LED.h Source File

LED.h

00001 /*--------------------------------------------------------------------------------
00002 Filename: LED.h
00003 Description: Header file for the Buzzer and LEDs
00004 --------------------------------------------------------------------------------*/
00005 
00006 #include "mbed.h"
00007 
00008 #ifndef LED_H
00009 #define LED_H
00010 
00011 #define DIAG_GRN PD_14
00012 #define DIAG_BLU PD_15
00013 #define DIAG_RED PF_12
00014 
00015 class cRGB_LED
00016 {
00017     
00018 public:
00019     cRGB_LED(DigitalOut DIAG_RED, PwmOut DIAG_BLU, PwmOut DIAG_GRN);  //Constructor, initialises the 3 outputs
00020     void red_led();     //Turns on Red LED
00021     void blue_led();    //Turns on Blue LED
00022     void green_led();   //Turns on Green LED
00023     void yellow_led();  //Turns on multiple LEDs to make yellow
00024     void orange_led(); //Turns on multiple LEDs to make orange
00025     void led_off();     //Turns all LEDs off
00026     void record_power(float vBatt); //Saves power value to private variable  for use inside class
00027     void display_power(); //Sets LED colour based on battery level
00028 private:
00029     DigitalOut _DIAG_RED;
00030     PwmOut _DIAG_BLU;       
00031     PwmOut _DIAG_GRN;
00032     float _battery_level;
00033 };
00034 
00035 
00036 #endif