Rev 7 | Rev 9 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 7 | Rev 8 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | #include "main.h" |
1 | #include "main.h" |
| 2 | #include "libOLED/stm32_halDisplay.H" |
2 | #include "libOLED/stm32_halDisplay.H" |
| 3 | #include "libOLED/fontclass.H" |
3 | #include "libOLED/fontclass.H" |
| - | 4 | #include "libOLED/displayDial.H" |
|
| 4 | 5 | ||
| 5 | namespace |
6 | namespace |
| 6 | { |
7 | { |
| 7 | int const WIDTH = 128; |
8 | int const WIDTH = 128; |
| 8 | int const HEIGHT = 64; |
9 | int const HEIGHT = 64; |
| Line 20... | Line 21... | ||
| 20 | SPI_RESET_GPIO_Port, |
21 | SPI_RESET_GPIO_Port, |
| 21 | SPI_RESET_Pin, |
22 | SPI_RESET_Pin, |
| 22 | SPI_NSS1_GPIO_Port, |
23 | SPI_NSS1_GPIO_Port, |
| 23 | SPI_NSS1_Pin); |
24 | SPI_NSS1_Pin); |
| 24 | 25 | ||
| - | 26 | ||
| - | 27 | displayDial_t dial (64, 64, 64); |
|
| 25 | int cnt = 0; |
28 | int cnt = 0; |
| 26 | 29 | ||
| 27 | 30 | ||
| 28 | extern "C" void |
31 | extern "C" void |
| 29 | cc_init () |
32 | cc_init () |
| 30 | { |
33 | { |
| 31 | display1.init(); |
34 | display1.init(); |
| 32 | display1.clearDisplay (); |
35 | display1.clearDisplay (); |
| 33 | 36 | ||
| 34 | display1.drawLine (0, 0, 127, 63, WHITE); |
37 | dial.draw_scale (display1, 0 , 10 , 4, 15 ,2); |
| 35 | 38 | ||
| 36 | display1.display (); |
39 | display1.display (); |
| 37 | } |
40 | } |
| 38 | 41 | ||
| 39 | 42 | ||
| Line 41... | Line 44... | ||
| 41 | cc_run() |
44 | cc_run() |
| 42 | { |
45 | { |
| 43 | if(cnt==0) |
46 | if(cnt==0) |
| 44 | display1.clearDisplay(); |
47 | display1.clearDisplay(); |
| 45 | 48 | ||
| - | 49 | display1.gotoxy(0,8); |
|
| - | 50 | display1.printString(small_font,"ABCDabcd",8,WHITE); |
|
| - | 51 | ||
| 46 | display1.gotoxy(0,16); |
52 | display1.gotoxy(0,16); |
| 47 | display1.printString(small_font,"Test",4,WHITE); |
53 | display1.printScaledString(small_font,"ABCD1234",8,128 |
| - | 54 | ,WHITE); |
|
| - | 55 | ||
| - | 56 | display1.gotoxy(0,48); |
|
| - | 57 | display1.printScaledString(large_font,"ABCD1234",8,256 |
|
| - | 58 | ,WHITE); |
|
| 48 | display1.drawLine(96,cnt,127,cnt,WHITE); |
59 | display1.drawLine(96,cnt,127,cnt,WHITE); |
| 49 | display1.display(); |
60 | display1.display(); |
| 50 | cnt++; |
61 | cnt++; |
| 51 | cnt%=64; |
62 | cnt%=64; |
| 52 | } |
63 | } |