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: 4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player
Diff: main.cpp
- Revision:
- 1:6553131e3bcf
- Parent:
- 0:e982498829af
- Child:
- 2:b78eabd8f218
--- a/main.cpp Fri Feb 26 16:44:26 2016 +0000
+++ b/main.cpp Fri Feb 26 17:04:20 2016 +0000
@@ -5,6 +5,7 @@
#include "uLCD_4DGL.h"
#include "wave_player.h"
#include "RGBLed.h"
+#include <string>
@@ -49,8 +50,8 @@
if (old_seed != seed){
old_seed = seed;
uLCD_mutex.lock();
- uLCD.filled_rectangle(20, 30, 100, 25,BLACK);
- uLCD.filled_rectangle(20, 30, 100/seed, 25, RED);
+ uLCD.filled_rectangle(30, 30, 100, 10,BLACK);
+ uLCD.filled_rectangle(30, 30, 100*seed, 10, RED);
uLCD_mutex.unlock();
}
@@ -63,8 +64,8 @@
//seed_mutex.lock();
seed = rand()/float(RAND_MAX);
//seed_mutex.unlock();
- rgb.write(seed*seed ,seed, seed*seed*seed); //Red, green, blue;
- Thread::wait(200);
+ rgb.write(seed/9 ,seed/5, seed/4); //Blue, green,red;
+ Thread::wait(150);
}
}
@@ -76,7 +77,7 @@
uLCD.text_height(2);
uLCD.text_italic(ON);
uLCD.background_color(BLACK);
- Thread thread1(uLCD2_thread);
+ //Thread thread1(uLCD2_thread);
Thread thread2(audio_thread);
Thread thread3(RGB_thread);
led1 = 1;
@@ -87,24 +88,24 @@
while (true) {
led2 = !led2;
- for( short i = 0, i <6, i++){
+ for( short i = 0; i <6; i++){
uLCD_mutex.lock();
- uLCD.locate(0,40);
- uLCD.printf("%o%s%s2\n\r", o, s, s2);
+ uLCD.locate(0,4);
+ uLCD.printf("%o%s%s2\n\r", o.c_str(), s.c_str(), s2.c_str());
uLCD_mutex.unlock();
o = o + " ";
- Thread::wait(600);
+ Thread::wait(1000);
}
o = " ";
- for( short i = 0, i <6, i++){
+ for( short i = 0; i <6; i++){
uLCD_mutex.lock();
- uLCD.locate(0,40);
- uLCD.printf("%s%02%s2\n\r", s, o2, s2);
+ uLCD.locate(0,4);
+ uLCD.printf("%s%02%s2\n\r", s.c_str(), o2.c_str(), s2.c_str());
uLCD_mutex.unlock();
o2 = o2 + "o";
- Thread::wait(600);
+ Thread::wait(1000);
}
o2 = "o";
}