Testé pour projet BTS SN
Fork of MODMAX7456 by
example1.cpp@1:780cc760c05f, 2016-04-30 (annotated)
- Committer:
- cdupaty
- Date:
- Sat Apr 30 17:10:04 2016 +0000
- Revision:
- 1:780cc760c05f
- Parent:
- 0:d7cd54ad4c3d
Test? pour projet BTS SN
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AjK | 0:d7cd54ad4c3d | 1 | #ifdef COMPILE_EXAMPLE_CODE_MODOSD7456 |
AjK | 0:d7cd54ad4c3d | 2 | |
AjK | 0:d7cd54ad4c3d | 3 | #include "mbed.h" |
AjK | 0:d7cd54ad4c3d | 4 | #include "OSD7456.h" |
AjK | 0:d7cd54ad4c3d | 5 | |
AjK | 0:d7cd54ad4c3d | 6 | DigitalOut led1(LED1); |
AjK | 0:d7cd54ad4c3d | 7 | |
AjK | 0:d7cd54ad4c3d | 8 | OSD7456 *osd; |
AjK | 0:d7cd54ad4c3d | 9 | |
AjK | 0:d7cd54ad4c3d | 10 | int main() { |
AjK | 0:d7cd54ad4c3d | 11 | |
AjK | 0:d7cd54ad4c3d | 12 | osd = new OSD7456(MAX7456_MOSI, MAX7456_MISO, MAX7456_SCLK, MAX7456_CS, MAX7456_RST, MAX7456_VSYNC); |
AjK | 0:d7cd54ad4c3d | 13 | |
AjK | 0:d7cd54ad4c3d | 14 | // Set the character "local background" to 42% |
AjK | 0:d7cd54ad4c3d | 15 | osd->max7456->backGround(MAX7456::Percent_42); |
AjK | 0:d7cd54ad4c3d | 16 | |
AjK | 0:d7cd54ad4c3d | 17 | // Set the blink rate to 133ms with a duty cycle of 3:1 |
AjK | 0:d7cd54ad4c3d | 18 | osd->max7456->blinkRate(MAX7456::ms_133, MAX7456::BT3_BT); |
AjK | 0:d7cd54ad4c3d | 19 | |
AjK | 0:d7cd54ad4c3d | 20 | osd->print(1, " Hello World"); |
AjK | 0:d7cd54ad4c3d | 21 | osd->print(7, 4, "Positioned text"); |
AjK | 0:d7cd54ad4c3d | 22 | osd->print(7, 6, "Positioned text", MAX7456::LocalBG); |
AjK | 0:d7cd54ad4c3d | 23 | osd->print(3, 8, "Positioned text blinks", MAX7456::Blink | MAX7456::LocalBG); |
AjK | 0:d7cd54ad4c3d | 24 | osd->print(4, 10, " Blinks and inverse ", MAX7456::Blink | MAX7456::LocalBG | MAX7456::Inverse); |
AjK | 0:d7cd54ad4c3d | 25 | |
AjK | 0:d7cd54ad4c3d | 26 | while(1) { |
AjK | 0:d7cd54ad4c3d | 27 | led1 = 1; |
AjK | 0:d7cd54ad4c3d | 28 | wait(0.5); |
AjK | 0:d7cd54ad4c3d | 29 | led1 = 0; |
AjK | 0:d7cd54ad4c3d | 30 | wait(0.5); |
AjK | 0:d7cd54ad4c3d | 31 | } |
AjK | 0:d7cd54ad4c3d | 32 | } |
AjK | 0:d7cd54ad4c3d | 33 | |
AjK | 0:d7cd54ad4c3d | 34 | #endif |