Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MARY_CAMERA NokiaLCD mbed
Diff: main.cpp
- Revision:
- 16:fa1bd83e34b0
- Parent:
- 15:c81a197f4f5b
- Child:
- 21:a2ac746dd516
--- a/main.cpp Wed Mar 05 06:36:24 2014 +0000 +++ b/main.cpp Thu Mar 06 07:29:25 2014 +0000 @@ -2,21 +2,35 @@ #include "MARMEX_OB_oled.h" #include "MARY_CAMERA.h" +#if defined( TARGET_MBED_LPC1768 ) || defined( TARGET_LPC11U24_401 ) + MARMEX_OB_oled oled1( p5, p7, p20, p16, p15 ); // mosi, sclk, cs, rst, power_control -- maple-mini-type-b-slot1 MARY_CAMERA camera( p5, p6, p7, p22, p26, p28, p27 ); // mosi, miso, sclk, cs, reset, I2C_SDA, I2C_SCL + +#endif + +#if defined( TARGET_LPC11U35_401 ) + +MARMEX_OB_oled oled1( P0_9, P0_10, P0_16, P0_12, P0_11 ); // mosi, sclk, cs, rst, power_control -- maple-mini-type-b-slot1 +MARY_CAMERA camera( P0_9, P0_8, P0_10, P0_2, P1_15, P0_5, P0_4 ); // mosi, miso, sclk, cs, reset, I2C_SDA, I2C_SCL + +#endif + BusOut led( LED3, LED4 ); #define X_OFFSET ((MARY_CAMERA::PIXEL_PER_LINE - MARMEX_OB_oled::WIDTH ) / 2) #define Y_OFFSET ((MARY_CAMERA::LINE_PER_FRAME - MARMEX_OB_oled::HEIGHT) / 2) void line_mirroring( short *buf ); +void oled_test_screen( void ); int main() { led = 0x3; oled1.cls(); - + oled_test_screen(); + short buf[ MARMEX_OB_oled::WIDTH ]; while ( 1 ) { @@ -53,4 +67,28 @@ #endif } -} \ No newline at end of file +} + + +void oled_test_screen( void ) +{ + oled1.background( 0x000000 ); + oled1.cls(); + + int colorbar_width = MARMEX_OB_oled::WIDTH / 8; + + for ( int i = 0; i < 8; i++ ) + oled1.fill( colorbar_width * i, 0, colorbar_width, MARMEX_OB_oled::HEIGHT, ((i & 0x4) ? 0xFF0000 : 0x000000) | ((i & 0x2) ? 0x00FF00 : 0x000000) | ((i & 0x1) ? 0x0000FF : 0x000000) ); + + oled1.fill( 50, 50, 64, 64, 0xCCCCCC );; + + oled1.locate( 0, 2 ); + oled1.printf( "MaryCemara test" ); + oled1.locate( 0, 4 ); + oled1.printf( "%s", (MARY_CAMERA::NO_ERROR == camera.ready()) ? "Camera is ready" : "No Camera found" ); + + for (int i = 0; i < MARMEX_OB_oled::WIDTH; i++ ) { + oled1.pixel( i, 80 + sin( (float)i / 5.0 ) * 10, 0x000000 ); + } + +}