![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Dependencies: BurstSPI EaEpaper TFT_fonts mbed
Fork of epaper_mbed_test by
main.cpp@2:03336b128c50, 2015-04-23 (annotated)
- Committer:
- Starz
- Date:
- Thu Apr 23 06:34:46 2015 +0000
- Revision:
- 2:03336b128c50
- Parent:
- 1:5ba919589a12
for valentinooo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dreschpe | 0:057244fcbbb6 | 1 | #include "mbed.h" |
dreschpe | 0:057244fcbbb6 | 2 | #include "EaEpaper.h" |
dreschpe | 0:057244fcbbb6 | 3 | #include "Arial28x28.h" |
dreschpe | 0:057244fcbbb6 | 4 | #include "Arial12x12.h" |
dreschpe | 0:057244fcbbb6 | 5 | #include "font_big.h" |
dreschpe | 0:057244fcbbb6 | 6 | #include "graphics.h" |
Starz | 2:03336b128c50 | 7 | #include <string> |
dreschpe | 0:057244fcbbb6 | 8 | |
dreschpe | 1:5ba919589a12 | 9 | EaEpaper epaper(p9, // PWR_CTRL |
dreschpe | 1:5ba919589a12 | 10 | p10, // BORDER |
dreschpe | 1:5ba919589a12 | 11 | p11, // DISCHARGE |
dreschpe | 1:5ba919589a12 | 12 | p12, // RESET_DISP |
dreschpe | 1:5ba919589a12 | 13 | p13, // BUSY |
dreschpe | 1:5ba919589a12 | 14 | p8, // SSEL |
dreschpe | 1:5ba919589a12 | 15 | p26, // PWM |
dreschpe | 1:5ba919589a12 | 16 | p5,p6,p7, // MOSI,MISO,SCLK |
dreschpe | 1:5ba919589a12 | 17 | p28,p27); // SDA,SCL |
dreschpe | 0:057244fcbbb6 | 18 | |
Starz | 2:03336b128c50 | 19 | Serial rs232(p13,p14); |
Starz | 2:03336b128c50 | 20 | Serial pc(USBTX, USBRX); // tx, rx |
Starz | 2:03336b128c50 | 21 | DigitalOut myled(LED1); |
Starz | 2:03336b128c50 | 22 | string cmd =""; |
dreschpe | 0:057244fcbbb6 | 23 | int main() { |
Starz | 2:03336b128c50 | 24 | |
Starz | 2:03336b128c50 | 25 | /* epaper.cls(); |
Starz | 2:03336b128c50 | 26 | epaper.setmode(1); |
dreschpe | 0:057244fcbbb6 | 27 | epaper.set_font((unsigned char*) Arial28x28); // select the font |
dreschpe | 0:057244fcbbb6 | 28 | epaper.locate(5,20); |
Starz | 2:03336b128c50 | 29 | |
Starz | 2:03336b128c50 | 30 | epaper.printf("Hello"); |
dreschpe | 0:057244fcbbb6 | 31 | epaper.rect(3,15,150,50,1); |
dreschpe | 0:057244fcbbb6 | 32 | |
Starz | 2:03336b128c50 | 33 | epaper.setmode(1); |
Starz | 2:03336b128c50 | 34 | epaper.circle(180,30,22,1); |
Starz | 2:03336b128c50 | 35 | epaper.write_disp(); // update screen*/ |
Starz | 2:03336b128c50 | 36 | pc.printf("Hello, i'm mbed !!!\r\n"); |
Starz | 2:03336b128c50 | 37 | rs232.baud(115200); |
Starz | 2:03336b128c50 | 38 | while (true) |
Starz | 2:03336b128c50 | 39 | { |
Starz | 2:03336b128c50 | 40 | if (rs232.readable()) |
Starz | 2:03336b128c50 | 41 | { |
Starz | 2:03336b128c50 | 42 | myled = !myled; |
Starz | 2:03336b128c50 | 43 | cmd = rs232.getc(); |
Starz | 2:03336b128c50 | 44 | pc.printf("%s\r\n",cmd); |
Starz | 2:03336b128c50 | 45 | |
Starz | 2:03336b128c50 | 46 | } |
Starz | 2:03336b128c50 | 47 | } |
dreschpe | 0:057244fcbbb6 | 48 | |
dreschpe | 0:057244fcbbb6 | 49 | } |