MARMEX_VB test application program. This application works on "mbed NXP LPC1768" only. This application expects to have the MARMEX_VB module on a "MAPLE mini type-B (MARM03-BASE)" baseboard (slot2) with MARMEX_OB module (on slot1)
Dependencies: MARMEX_VB NokiaLCD mbed
This is the library test program.
The program can test features of the library (refer to MARMEX-VB's API document) and can save captured data into BMP file.
Warning!
This test program can run on "mbed NXP LPC1768" only.
Picture : sample of test program operation
The modules of MARMEX-VB and MARMEX-OB are set on the "MAPLE mini type-B (MARM03-BASE)" baseboard.
The image data from camera is mirrored and alpha graphics added by software.
Diff: main.cpp
- Revision:
- 1:dbe2dc31542d
- Parent:
- 0:343c01965543
- Child:
- 6:b61b876d50a8
--- a/main.cpp Fri Jun 06 03:37:02 2014 +0000 +++ b/main.cpp Mon Jun 09 19:42:34 2014 +0000 @@ -1,6 +1,6 @@ /** Test program for MARMEX_VB Camera control library * - * @version 0.1 + * @version 0.2 * @date 10-Jun-2014 * * Released under the Apache License, Version 2.0 : http://mbed.org/handbook/Apache-Licence @@ -29,6 +29,7 @@ void test_camera_resolution_change( void ); void copy_image_from_camera_to_oled( void ); +void copy_image_from_camera_to_oled_small( void ); void copy_image_from_camera_to_oled_interlaced( void ); void line_mirroring( short *buf ); void save_still_image( char *file_name ); @@ -144,7 +145,6 @@ else copy_image_from_camera_to_oled(); - // camera.colorbar( ((count++ >> 2) & 0x1) ? MARMEX_VB::ON : MARMEX_VB::OFF ); led = 0x2; @@ -197,7 +197,7 @@ void copy_image_from_camera_to_oled( void ) { - short buf[ MARMEX_OB_oled::WIDTH ]; + short buf[ MARMEX_OB_oled::WIDTH ]; // array size should be multiple of 8 for "mbed LPC1768" optimization static int count = 0; camera.open_transfer(); @@ -214,6 +214,23 @@ } +void copy_image_from_camera_to_oled_small( void ) +{ + short buf[ 64 ]; + static int count = 0; + + camera.open_transfer(); + + for ( int line = 0; line < 64; line++ ) { + camera.read_a_line( buf, line, 0, 64 ); + oled1.blit565( 0, line, 64, 1, buf ); + } + + count++; + camera.close_transfer(); +} + + void copy_image_from_camera_to_oled_interlaced( void ) { short buf[ MARMEX_OB_oled::WIDTH ]; @@ -262,7 +279,7 @@ oled1.locate( 0, 3 ); oled1.printf( "%s", (MARMEX_VB::NO_ERROR == camera.ready()) ? "Camera is ready" : "No Camera found" ); oled1.locate( 0, 4 ); - oled1.printf( "%s", "saving into BMP" ); + //oled1.printf( "%s", "saving into BMP" ); oled1.locate( 0, 5 ); oled1.printf( "%d", camera.get_horizontal_size() ); oled1.locate( 0, 6 );