Lee Kai Xuan / mbed-os

Fork of mbed-os by erkin yucel

Committer:
xuaner
Date:
Thu Jul 20 14:26:57 2017 +0000
Revision:
1:3deb71413561
Parent:
0:f269e3021894
mbed_os

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
elessair 0:f269e3021894 2 *
elessair 0:f269e3021894 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
elessair 0:f269e3021894 4 * and associated documentation files (the "Software"), to deal in the Software without
elessair 0:f269e3021894 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
elessair 0:f269e3021894 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
elessair 0:f269e3021894 7 * Software is furnished to do so, subject to the following conditions:
elessair 0:f269e3021894 8 *
elessair 0:f269e3021894 9 * The above copyright notice and this permission notice shall be included in all copies or
elessair 0:f269e3021894 10 * substantial portions of the Software.
elessair 0:f269e3021894 11 *
elessair 0:f269e3021894 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
elessair 0:f269e3021894 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
elessair 0:f269e3021894 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
elessair 0:f269e3021894 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
elessair 0:f269e3021894 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
elessair 0:f269e3021894 17 */
elessair 0:f269e3021894 18
elessair 0:f269e3021894 19 #include "test_env.h"
elessair 0:f269e3021894 20 #include "mbed.h"
elessair 0:f269e3021894 21 #include "C12832.h"
elessair 0:f269e3021894 22
elessair 0:f269e3021894 23 int main()
elessair 0:f269e3021894 24 {
elessair 0:f269e3021894 25 MBED_HOSTTEST_TIMEOUT(15);
elessair 0:f269e3021894 26 MBED_HOSTTEST_SELECT(default_auto);
elessair 0:f269e3021894 27 MBED_HOSTTEST_DESCRIPTION(SPI C12832 display);
elessair 0:f269e3021894 28 MBED_HOSTTEST_START("MBED_35");
elessair 0:f269e3021894 29
elessair 0:f269e3021894 30 C12832 lcd(D11, D13, D12, D7, D10);
elessair 0:f269e3021894 31
elessair 0:f269e3021894 32 // clear the screen
elessair 0:f269e3021894 33 lcd.cls();
elessair 0:f269e3021894 34
elessair 0:f269e3021894 35 // print the first line and wait 3 sec
elessair 0:f269e3021894 36 lcd.locate(0,3);
elessair 0:f269e3021894 37 lcd.printf("mbed application board!");
elessair 0:f269e3021894 38
elessair 0:f269e3021894 39 // print the counter prefix; the number will be printed in the while loop
elessair 0:f269e3021894 40 lcd.locate(0,15);
elessair 0:f269e3021894 41 lcd.printf("Counting:");
elessair 0:f269e3021894 42
elessair 0:f269e3021894 43 int i=1, j=0;
elessair 0:f269e3021894 44 while(i++,i<=200) {
elessair 0:f269e3021894 45 lcd.locate(42,15);
elessair 0:f269e3021894 46 lcd.printf("%d", i);
elessair 0:f269e3021894 47 if (i % 50 == 0) {
elessair 0:f269e3021894 48 lcd.invert(j = j ? 0 : 1);
elessair 0:f269e3021894 49 };
elessair 0:f269e3021894 50 wait(0.001);
elessair 0:f269e3021894 51 }
elessair 0:f269e3021894 52
elessair 0:f269e3021894 53 MBED_HOSTTEST_RESULT(1);
elessair 0:f269e3021894 54 }