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.
Dependencies: mbed
Fork of WaG by
Diff: display.cpp
- Revision:
- 39:abf211b17e3c
- Parent:
- 32:0dc2b4a3eee6
- Child:
- 42:6cba679a4ee4
diff -r 57af77435ae1 -r abf211b17e3c display.cpp
--- a/display.cpp Fri Mar 23 19:32:39 2018 +0000
+++ b/display.cpp Fri Mar 23 20:16:24 2018 +0000
@@ -25,6 +25,7 @@
extern SPI wag_spi;
extern spi_cfg as1107;
+extern Serial pc;
/*
* void initial_setup(struct spi_cfg spi_obj);
@@ -156,15 +157,15 @@
* Returns: void
*/
void test_target_leds() {
- int pressed = uti_chk_ubutton();
int led_command = 0;
- while (pressed == 0);
- while (pressed == 0) {
- for (int i = 0x1; i <= 0x8; i++) {
+ while (uti_chk_ubutton() == 0);
+ pc.printf("test begin\n");
+ while (uti_chk_ubutton() == 0) {
+ for (int i = 1; i <= 128; i = i * 2) {
led_command = 0x0500 + i;
spi_send(as1107, led_command); //light up LED[i]
wait(0.1);
spi_send(as1107, 0x0500); //turn off LED[i]
}
}
-}
\ No newline at end of file
+}
