OSDN Git Service

Remove all samples. They will work well and useful for reference. But there is no...
[nxt-jsp/etrobo-atk.git] / nxtOSEK / samples_c++ / cpp / Speaker / sample.cpp
diff --git a/nxtOSEK/samples_c++/cpp/Speaker/sample.cpp b/nxtOSEK/samples_c++/cpp/Speaker/sample.cpp
deleted file mode 100644 (file)
index f9a504a..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* sample.cpp for TOPPERS/ATK(OSEK) */ \r
-\r
-\r
-// ECRobot++ API\r
-#include "Speaker.h"\r
-#include "Nxt.h"\r
-#include "Clock.h"\r
-#include "Lcd.h"\r
-using namespace ecrobot;\r
\r
-extern "C"\r
-{\r
-#include "kernel.h"\r
-#include "kernel_id.h"\r
-#include "ecrobot_interface.h"\r
-\r
-\r
-// I am not sure these are proper notes\r
-const U32 TONE_TABLE[6][12] =\r
-{\r
-       // C     C#    D     D#    E     F     F#    G     G#    A     A#   B\r
-       {  33,   35,   37,   39,   41,   44,   46,   49,   52,   55,   58,   62},\r
-       {  65,   69,   73,   78,   82,   87,   92,   98,  104,  110,  117,  123},\r
-       { 131,  139,  147,  156,  165,  175,  185,  196,  208,  220,  233,  247},\r
-       { 262,  277,  294,  311,  330,  349,  370,  392,  415,  440,  466,  494},\r
-       { 523,  554,  587,  622,  659,  698,  740,  784,  831,  880,  932,  988},\r
-       {1047, 1109, 1175, 1245, 1319, 1397, 1480, 1568, 1661, 1760, 1865, 1976}\r
-};\r
-\r
-#ifdef PLAY_WAV\r
-// playing WAV file consumes tons of memory, so it needs to use NXT BIOS\r
-EXTERNAL_WAV_DATA(lego_mindstorms_nxt); // lego_mindstorms_nxt.wav (just speaks "LEGO MINDSTORMS NXT")\r
-#endif\r
-\r
-/* nxtOSEK hook to be invoked from an ISR in category 2 */\r
-void user_1ms_isr_type2(void)\r
-{\r
-       SleeperMonitor(); // needed for I2C device and Clock classes\r
-}\r
-\r
-TASK(TaskMain)\r
-{\r
-       Speaker speaker;\r
-       Nxt nxt;\r
-       Clock clock;\r
-       Lcd lcd;\r
-\r
-       lcd.clear();\r
-       lcd.putf("s", "Speaker");\r
-       lcd.disp();\r
-\r
-       while(1)\r
-       {\r
-#ifdef PLAY_WAV\r
-               if (nxt.getButtons() == Nxt::RUN_ON)\r
-               {\r
-                       speaker.playWav(WAV_DATA_START(lego_mindstorms_nxt), \r
-                               (U32)WAV_DATA_SIZE(lego_mindstorms_nxt), 70);\r
-                       clock.wait(100);\r
-               }\r
-#endif\r
-               if (nxt.getButtons() == Nxt::ENTR_ON)\r
-               {\r
-                       for (SINT scale = 0; scale < 6; scale++)\r
-                       {\r
-                               for (SINT note = 0; note < 12; note++)\r
-                               {\r
-                                       speaker.playTone(TONE_TABLE[scale][note], 200, 20);\r
-                                       clock.wait(200);\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-}\r
-\r
-}\r