Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Servo ros_lib_kinetic
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
Generated on Wed Jul 13 2022 08:03:54 by
1.7.2