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.
main.c@0:748338cb3553, 2010-12-17 (annotated)
- Committer:
- Wijnand
- Date:
- Fri Dec 17 22:19:04 2010 +0000
- Revision:
- 0:748338cb3553
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wijnand | 0:748338cb3553 | 1 | /* This file has been prepared for Doxygen **************************/ |
Wijnand | 0:748338cb3553 | 2 | |
Wijnand | 0:748338cb3553 | 3 | /*! \file main.c ***************************************************** |
Wijnand | 0:748338cb3553 | 4 | * |
Wijnand | 0:748338cb3553 | 5 | * \brief Test program for the compiler chain and the the mbed NXP |
Wijnand | 0:748338cb3553 | 6 | * LPC1768 target. |
Wijnand | 0:748338cb3553 | 7 | * |
Wijnand | 0:748338cb3553 | 8 | * Uses the module: delay. |
Wijnand | 0:748338cb3553 | 9 | * |
Wijnand | 0:748338cb3553 | 10 | * Copyright (C) 2008 W.Nijs (ALF4all) |
Wijnand | 0:748338cb3553 | 11 | * |
Wijnand | 0:748338cb3553 | 12 | * This program is free software: you can redistribute it and/or modify |
Wijnand | 0:748338cb3553 | 13 | * it under the terms of the GNU General Public License as published by |
Wijnand | 0:748338cb3553 | 14 | * the Free Software Foundation, either version 3 of the License, or |
Wijnand | 0:748338cb3553 | 15 | * (at your option) any later version. |
Wijnand | 0:748338cb3553 | 16 | * |
Wijnand | 0:748338cb3553 | 17 | * This program is distributed in the hope that it will be useful, |
Wijnand | 0:748338cb3553 | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Wijnand | 0:748338cb3553 | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Wijnand | 0:748338cb3553 | 20 | * GNU General Public License for more details. |
Wijnand | 0:748338cb3553 | 21 | * |
Wijnand | 0:748338cb3553 | 22 | * You should have received a copy of the GNU General Public License |
Wijnand | 0:748338cb3553 | 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
Wijnand | 0:748338cb3553 | 24 | * |
Wijnand | 0:748338cb3553 | 25 | * \author W.Nijs. |
Wijnand | 0:748338cb3553 | 26 | * \date 12/03/2009 |
Wijnand | 0:748338cb3553 | 27 | * \version 1.0 12/03/2009, initial revision. |
Wijnand | 0:748338cb3553 | 28 | * \version 2.0 28/05/2010, prepared for Doxygen. |
Wijnand | 0:748338cb3553 | 29 | * |
Wijnand | 0:748338cb3553 | 30 | *********************************************************************/ |
Wijnand | 0:748338cb3553 | 31 | |
Wijnand | 0:748338cb3553 | 32 | /*****************************************************************//** |
Wijnand | 0:748338cb3553 | 33 | * Include section |
Wijnand | 0:748338cb3553 | 34 | * Add all #includes here |
Wijnand | 0:748338cb3553 | 35 | *********************************************************************/ |
Wijnand | 0:748338cb3553 | 36 | |
Wijnand | 0:748338cb3553 | 37 | #include "mbed.h" |
Wijnand | 0:748338cb3553 | 38 | #include "delay.h" |
Wijnand | 0:748338cb3553 | 39 | |
Wijnand | 0:748338cb3553 | 40 | |
Wijnand | 0:748338cb3553 | 41 | /*****************************************************************//** |
Wijnand | 0:748338cb3553 | 42 | * \brief main |
Wijnand | 0:748338cb3553 | 43 | * |
Wijnand | 0:748338cb3553 | 44 | * Testprogram heartbeat-0, using LED1. |
Wijnand | 0:748338cb3553 | 45 | * |
Wijnand | 0:748338cb3553 | 46 | * \author W.Nijs. |
Wijnand | 0:748338cb3553 | 47 | * \date 28-05-2010 |
Wijnand | 0:748338cb3553 | 48 | *********************************************************************/ |
Wijnand | 0:748338cb3553 | 49 | |
Wijnand | 0:748338cb3553 | 50 | DigitalOut heartbeat(LED1); |
Wijnand | 0:748338cb3553 | 51 | |
Wijnand | 0:748338cb3553 | 52 | int main() { |
Wijnand | 0:748338cb3553 | 53 | int i = 0; |
Wijnand | 0:748338cb3553 | 54 | |
Wijnand | 0:748338cb3553 | 55 | while (1) { |
Wijnand | 0:748338cb3553 | 56 | if ((i==0)||(i==3)) { |
Wijnand | 0:748338cb3553 | 57 | heartbeat = 1; |
Wijnand | 0:748338cb3553 | 58 | } else { |
Wijnand | 0:748338cb3553 | 59 | heartbeat = 0; |
Wijnand | 0:748338cb3553 | 60 | }; |
Wijnand | 0:748338cb3553 | 61 | if (i>=9) { |
Wijnand | 0:748338cb3553 | 62 | i = 0; |
Wijnand | 0:748338cb3553 | 63 | } else { |
Wijnand | 0:748338cb3553 | 64 | i++; |
Wijnand | 0:748338cb3553 | 65 | }; |
Wijnand | 0:748338cb3553 | 66 | |
Wijnand | 0:748338cb3553 | 67 | delay(100); |
Wijnand | 0:748338cb3553 | 68 | }; |
Wijnand | 0:748338cb3553 | 69 | |
Wijnand | 0:748338cb3553 | 70 | return 0; |
Wijnand | 0:748338cb3553 | 71 | }; |