fork of Official_mBuino
Dependencies: mbed
Fork of Official_mBuino by
main.cpp@6:475e3427347a, 2015-05-20 (annotated)
- Committer:
- David Yeske
- Date:
- Wed May 20 17:55:13 2015 -0400
- Revision:
- 6:475e3427347a
- Parent:
- 5:a83428759e19
fix comment
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gusissa | 1:f89a6b63eae7 | 1 | /* |
gusissa | 1:f89a6b63eae7 | 2 | ** This software can be freely used, even comercially, as highlighted in the license. |
gusissa | 1:f89a6b63eae7 | 3 | ** |
gusissa | 1:f89a6b63eae7 | 4 | ** Copyright 2014 GHI Electronics, LLC |
gusissa | 1:f89a6b63eae7 | 5 | ** |
gusissa | 1:f89a6b63eae7 | 6 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
gusissa | 1:f89a6b63eae7 | 7 | ** you may not use this file except in compliance with the License. |
gusissa | 1:f89a6b63eae7 | 8 | ** You may obtain a copy of the License at |
gusissa | 1:f89a6b63eae7 | 9 | ** |
gusissa | 1:f89a6b63eae7 | 10 | ** http://www.apache.org/licenses/LICENSE-2.0 |
gusissa | 1:f89a6b63eae7 | 11 | ** |
gusissa | 1:f89a6b63eae7 | 12 | ** Unless required by applicable law or agreed to in writing, software |
gusissa | 1:f89a6b63eae7 | 13 | ** distributed under the License is distributed on an "AS IS" BASIS, |
gusissa | 1:f89a6b63eae7 | 14 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
gusissa | 1:f89a6b63eae7 | 15 | ** See the License for the specific language governing permissions and |
gusissa | 1:f89a6b63eae7 | 16 | ** limitations under the License. |
gusissa | 1:f89a6b63eae7 | 17 | ** |
gusissa | 1:f89a6b63eae7 | 18 | **/ |
gusissa | 1:f89a6b63eae7 | 19 | |
David Yeske |
6:475e3427347a | 20 | //fix the comment |
David Yeske |
5:a83428759e19 | 21 | |
Experiment626 | 0:c72235e68f52 | 22 | #include "mbed.h" |
Experiment626 | 0:c72235e68f52 | 23 | |
Experiment626 | 0:c72235e68f52 | 24 | DigitalOut LED[] = {(LED1), (LED2), (LED3), (LED4), (LED5), (LED6), (LED7)};// declare 7 LEDs |
Experiment626 | 0:c72235e68f52 | 25 | |
Experiment626 | 0:c72235e68f52 | 26 | float delayTime = .05; |
dyeske | 2:4430b59c748f | 27 | float delayMe = .01; |
Experiment626 | 0:c72235e68f52 | 28 | |
dyeske | 2:4430b59c748f | 29 | int main() { |
David Yeske |
3:59a791514a87 | 30 | |
dyeske | 2:4430b59c748f | 31 | while(1) { |
Experiment626 | 0:c72235e68f52 | 32 | delayTime = 0.05; |
David Yeske |
3:59a791514a87 | 33 | for(int x = 0; x < 7; x++) { |
Experiment626 | 0:c72235e68f52 | 34 | LED[x] = 1; // turn on |
dyeske | 2:4430b59c748f | 35 | wait(delayMe); // delay |
Experiment626 | 0:c72235e68f52 | 36 | |
Experiment626 | 0:c72235e68f52 | 37 | LED[x] = 0; // turn off |
Experiment626 | 0:c72235e68f52 | 38 | wait(delayTime); // delay |
Experiment626 | 0:c72235e68f52 | 39 | } |
David Yeske |
3:59a791514a87 | 40 | for(int x = 6; x >= 0; x--) { |
Experiment626 | 0:c72235e68f52 | 41 | LED[x] = 1; // turn on |
David Yeske |
4:f91b7024a784 | 42 | wait(delayMe); // delay |
Experiment626 | 0:c72235e68f52 | 43 | |
Experiment626 | 0:c72235e68f52 | 44 | LED[x] = 0; // turn off |
Experiment626 | 0:c72235e68f52 | 45 | wait(delayTime); // delay |
Experiment626 | 0:c72235e68f52 | 46 | } |
Experiment626 | 0:c72235e68f52 | 47 | |
David Yeske |
3:59a791514a87 | 48 | for(int x = 0; x < 7; x++) { |
Experiment626 | 0:c72235e68f52 | 49 | LED[x] = 1; // turn on |
Experiment626 | 0:c72235e68f52 | 50 | wait(delayTime); // delay |
Experiment626 | 0:c72235e68f52 | 51 | } |
David Yeske |
3:59a791514a87 | 52 | for(int x = 6; x >= 0; x--) { |
Experiment626 | 0:c72235e68f52 | 53 | LED[x] = 0; // turn off |
Experiment626 | 0:c72235e68f52 | 54 | wait(delayTime); // delay |
Experiment626 | 0:c72235e68f52 | 55 | } |
Experiment626 | 0:c72235e68f52 | 56 | |
Experiment626 | 0:c72235e68f52 | 57 | |
Experiment626 | 0:c72235e68f52 | 58 | } |
Experiment626 | 0:c72235e68f52 | 59 | } |