Hello World for RenBED platform. Demonstrates use of RenBED and its seven segment displays

Dependencies:   SevenSegmentDisplay mbed

Committer:
ELloyd
Date:
Tue Mar 11 13:44:04 2014 +0000
Revision:
0:0e9850b7b584
RenBED Hello World; Demonstrates use of RenBED and its seven segment displays.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ELloyd 0:0e9850b7b584 1 /*******************************************************************************
ELloyd 0:0e9850b7b584 2 * RenBED "Hello World" counter *
ELloyd 0:0e9850b7b584 3 * Copyright (c) 2014 Elizabeth Lloyd *
ELloyd 0:0e9850b7b584 4 * *
ELloyd 0:0e9850b7b584 5 * Permission is hereby granted, free of charge, to any person obtaining a copy *
ELloyd 0:0e9850b7b584 6 * of this software and associated documentation files (the "Software"), to deal*
ELloyd 0:0e9850b7b584 7 * in the Software without restriction, including without limitation the rights *
ELloyd 0:0e9850b7b584 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
ELloyd 0:0e9850b7b584 9 * copies of the Software, and to permit persons to whom the Software is *
ELloyd 0:0e9850b7b584 10 * furnished to do so, subject to the following conditions: *
ELloyd 0:0e9850b7b584 11 * *
ELloyd 0:0e9850b7b584 12 * The above copyright notice and this permission notice shall be included in *
ELloyd 0:0e9850b7b584 13 * all copies or substantial portions of the Software. *
ELloyd 0:0e9850b7b584 14 * *
ELloyd 0:0e9850b7b584 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
ELloyd 0:0e9850b7b584 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
ELloyd 0:0e9850b7b584 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
ELloyd 0:0e9850b7b584 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
ELloyd 0:0e9850b7b584 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,*
ELloyd 0:0e9850b7b584 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
ELloyd 0:0e9850b7b584 21 * THE SOFTWARE. *
ELloyd 0:0e9850b7b584 22 * *
ELloyd 0:0e9850b7b584 23 * RenBED Hello World *
ELloyd 0:0e9850b7b584 24 * *
ELloyd 0:0e9850b7b584 25 * V1.0 11/03/2014 First issue of code Elizabeth Lloyd *
ELloyd 0:0e9850b7b584 26 *******************************************************************************/
ELloyd 0:0e9850b7b584 27
ELloyd 0:0e9850b7b584 28 #include "mbed.h"
ELloyd 0:0e9850b7b584 29 #include "SevenSegmentDisplay.h"
ELloyd 0:0e9850b7b584 30
ELloyd 0:0e9850b7b584 31 DigitalOut myled(P0_23);
ELloyd 0:0e9850b7b584 32
ELloyd 0:0e9850b7b584 33 void Display();
ELloyd 0:0e9850b7b584 34
ELloyd 0:0e9850b7b584 35
ELloyd 0:0e9850b7b584 36 SevenSegmentDisplay Numbers(INSTANT);
ELloyd 0:0e9850b7b584 37
ELloyd 0:0e9850b7b584 38 int main()
ELloyd 0:0e9850b7b584 39 {
ELloyd 0:0e9850b7b584 40 int i = 0;
ELloyd 0:0e9850b7b584 41 wait(1.0);
ELloyd 0:0e9850b7b584 42 while (1) {
ELloyd 0:0e9850b7b584 43 if (i < 99) {
ELloyd 0:0e9850b7b584 44 i++;
ELloyd 0:0e9850b7b584 45 } else {
ELloyd 0:0e9850b7b584 46 i = 0;
ELloyd 0:0e9850b7b584 47 }
ELloyd 0:0e9850b7b584 48 Numbers.DisplayInt(i);
ELloyd 0:0e9850b7b584 49 wait(1.0);
ELloyd 0:0e9850b7b584 50 }
ELloyd 0:0e9850b7b584 51 }
ELloyd 0:0e9850b7b584 52
ELloyd 0:0e9850b7b584 53