Alex Allen / flash
Committer:
AlexAllen
Date:
Sat Oct 13 11:20:18 2012 +0000
Revision:
1:3c829c6b7d39
Parent:
0:8f42ebd85c7a
Child:
2:dfc82b5b4124
A collection of light flashing functions

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AlexAllen 1:3c829c6b7d39 1 /* Copyright (c) <year> <copyright holders>, MIT License
AlexAllen 1:3c829c6b7d39 2 *
AlexAllen 1:3c829c6b7d39 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
AlexAllen 1:3c829c6b7d39 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
AlexAllen 1:3c829c6b7d39 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
AlexAllen 1:3c829c6b7d39 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
AlexAllen 1:3c829c6b7d39 7 * furnished to do so, subject to the following conditions:
AlexAllen 1:3c829c6b7d39 8 *
AlexAllen 1:3c829c6b7d39 9 * The above copyright notice and this permission notice shall be included in all copies or
AlexAllen 1:3c829c6b7d39 10 * substantial portions of the Software.
AlexAllen 1:3c829c6b7d39 11 *
AlexAllen 1:3c829c6b7d39 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
AlexAllen 1:3c829c6b7d39 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
AlexAllen 1:3c829c6b7d39 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
AlexAllen 1:3c829c6b7d39 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
AlexAllen 1:3c829c6b7d39 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AlexAllen 1:3c829c6b7d39 17 */
AlexAllen 1:3c829c6b7d39 18 #ifndef FLASHY
AlexAllen 0:8f42ebd85c7a 19
AlexAllen 0:8f42ebd85c7a 20 /* Lights up each LED in turn starting from the left going
AlexAllen 0:8f42ebd85c7a 21 to the right and then back again */
AlexAllen 0:8f42ebd85c7a 22 void lightup();
AlexAllen 0:8f42ebd85c7a 23
AlexAllen 0:8f42ebd85c7a 24 // 5 second timer counting down on LEDs
AlexAllen 0:8f42ebd85c7a 25 void timer();
AlexAllen 0:8f42ebd85c7a 26
AlexAllen 0:8f42ebd85c7a 27 /* flashes all LEDs on and off at once "times" number of time
AlexAllen 0:8f42ebd85c7a 28 with a gap of "gap" seconds between flashes */
AlexAllen 0:8f42ebd85c7a 29 void flash(int times, float gap);
AlexAllen 0:8f42ebd85c7a 30
AlexAllen 0:8f42ebd85c7a 31 // Single flash on led1 for "gap" seconds
AlexAllen 0:8f42ebd85c7a 32 void flash1(float gap);
AlexAllen 0:8f42ebd85c7a 33
AlexAllen 0:8f42ebd85c7a 34 // Single flash on led1 for "gap" seconds
AlexAllen 0:8f42ebd85c7a 35 void flash2(float gap);
AlexAllen 0:8f42ebd85c7a 36
AlexAllen 0:8f42ebd85c7a 37 /* inifite loop indicating something has failed terminally
AlexAllen 0:8f42ebd85c7a 38 and mbed needs reseting. Flashes outer then inner LEDs */
AlexAllen 0:8f42ebd85c7a 39 void errormsg1(float gap);
AlexAllen 0:8f42ebd85c7a 40
AlexAllen 0:8f42ebd85c7a 41 /* inifite loop indicating something has failed terminally
AlexAllen 0:8f42ebd85c7a 42 and mbed needs reseting. Flashes outer then inner LEDs */
AlexAllen 0:8f42ebd85c7a 43 void errormsg2(float gap);
AlexAllen 0:8f42ebd85c7a 44
AlexAllen 0:8f42ebd85c7a 45 // LEDs light up one at a time until all are lit
AlexAllen 0:8f42ebd85c7a 46 void signal(float gap);
AlexAllen 0:8f42ebd85c7a 47
AlexAllen 0:8f42ebd85c7a 48 #define FLASHY 1
AlexAllen 0:8f42ebd85c7a 49 #endif