![](/media/cache/profiles/83bdd5a91e556ca3b57aafab83ee8ef5.50x50_q85.jpg)
This program is for "LEDCUBE4mbed". You can change the mode for changing the value of "debug".
Dependencies: ConfigFile FatFileSystem SDFileSystem mbed
Diff: main.cpp
- Revision:
- 1:0991aefbe7be
- Parent:
- 0:bedae49a4612
- Child:
- 2:96833c69287d
--- a/main.cpp Thu Aug 09 08:24:07 2012 +0000 +++ b/main.cpp Thu Aug 09 09:01:48 2012 +0000 @@ -73,17 +73,27 @@ char buf_key[BUFSIZ]; char buf_value[BUFSIZ]; - int n; long sin2; - for (int i = 0; i < cnt; i++) { + leds = 0; if (cfg.getKeyAndValue(i, buf_key, sizeof(buf_key), buf_value, sizeof(buf_value))) { //printf("No.%3d:'%s'='%s'\n", i, buf_key, buf_value); sin2 = strtol(buf_value, NULL, 2); printf("%d = %d\n", i+1, sin2); + C5 = sin2 & 0x1; + C4 = (sin2 >> 1) & 0x1; + C3 = (sin2 >> 2) & 0x1; + C2 = (sin2 >> 3) & 0x1; + C1 = (sin2 >> 4) & 0x1; + + leds = 1; + wait(0.1); + leds = 0; + wait(0.4); + } else { printf("No.%3d:Failure to get a configuration.\n", i); }