su su / Pancake_mbed
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pancake.hpp Source File

pancake.hpp

00001 #include "mbed.h"
00002 
00003 typedef enum Pancake_Color{
00004     P_Black,
00005     P_White,
00006     P_Red,
00007     P_Peach,
00008     P_Orange,
00009     P_Yellow,
00010     P_PaleBrown,
00011     P_Brown,
00012     P_YellowGreen,
00013     P_Green,
00014     P_LiteBlue,
00015     P_Bule,
00016     P_DarkBule,
00017     P_BluePurple,
00018     P_RedPurple,
00019     P_Gray
00020     }P_Color;
00021 typedef enum Pancake_Image{
00022     P_Pancake,
00023     P_Grassland,
00024     P_Road,
00025     P_Wilderness,
00026     P_Sea,
00027     P_Sky,
00028     P_Space,
00029     P_Castle
00030     }P_Image;
00031 class sound_t{
00032     public:
00033     sound_t()
00034    {
00035    }
00036 
00037    sound_t(uint8_t oc,uint8_t sc,uint8_t tc) 
00038    {
00039        octave = oc;
00040        scale = sc;
00041        toneColor = tc; 
00042    }
00043     
00044     uint8_t octave;
00045     uint8_t scale;
00046     uint8_t toneColor;
00047     };
00048 
00049 
00050 class Pancake {
00051     public:
00052     Pancake(PinName tx,PinName rx);
00053     //~Pancake();
00054     void sound1(uint8_t cn,sound_t &sound);
00055     void sound(sound_t sounds[4]);
00056     void setMusic(uint8_t channel,bool mode,uint8_t tempo,
00057                     uint8_t toneColor,uint8_t score[],uint8_t size);
00058     void playMusic();
00059     void stopMusic();
00060     void reset();
00061     
00062     void clearScreen(P_Color color);
00063     void writeLine(uint8_t sx,uint8_t sy,uint8_t ex,uint8_t ey,P_Color color);
00064     void writeCircle(uint8_t centerx,uint8_t centery,uint8_t radius,P_Color color);
00065     void writeStamp();
00066     void writeImage();
00067 
00068     private:
00069     void sendCommand(uint8_t data[],uint8_t length);
00070     Serial pc;
00071     uint8_t spriteMode;
00072 };