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
main.cpp@4:5e1828a8e238, 2014-02-14 (annotated)
- Committer:
- okano
- Date:
- Fri Feb 14 14:20:08 2014 +0000
- Revision:
- 4:5e1828a8e238
- Parent:
- 3:152362acd181
- Child:
- 6:f5b4e088087b
c++ lib version *doesn't work*
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 0:1062142e5718 | 1 | #include "mbed.h" |
okano | 0:1062142e5718 | 2 | #include "MARMEX_OB_oled.h" |
okano | 4:5e1828a8e238 | 3 | #include "MARY_CAMERA.h" |
okano | 3:152362acd181 | 4 | |
okano | 3:152362acd181 | 5 | |
okano | 4:5e1828a8e238 | 6 | MARMEX_OB_oled oled1( p5, p7, p20, p16, p15 ); // mosi, sclk, cs, rst, power_control -- maple-mini-type-b-slot1 |
okano | 4:5e1828a8e238 | 7 | MARY_CAMERA camera( p5, p6, p7, p22, p9, p26, p28, p27 ); // mosi, miso, sclk, cs, vsync, reset, I2C_SDA, I2C_SCL |
okano | 1:ce27bc7b44d4 | 8 | |
okano | 1:ce27bc7b44d4 | 9 | #define X_OFFSET 24 |
okano | 1:ce27bc7b44d4 | 10 | #define Y_OFFSET 8 |
okano | 0:1062142e5718 | 11 | |
okano | 0:1062142e5718 | 12 | int main() |
okano | 0:1062142e5718 | 13 | { |
okano | 1:ce27bc7b44d4 | 14 | oled1.cls(); |
okano | 1:ce27bc7b44d4 | 15 | |
okano | 3:152362acd181 | 16 | short buf[ 128 ]; |
okano | 4:5e1828a8e238 | 17 | camera.init(); |
okano | 4:5e1828a8e238 | 18 | |
okano | 4:5e1828a8e238 | 19 | printf( "init done\r\n" ); |
okano | 0:1062142e5718 | 20 | |
okano | 0:1062142e5718 | 21 | while ( 1 ) { |
okano | 4:5e1828a8e238 | 22 | camera.open_transfer(); |
okano | 0:1062142e5718 | 23 | |
okano | 3:152362acd181 | 24 | for ( int line = 0; line < 128; line++ ) { |
okano | 4:5e1828a8e238 | 25 | camera.transfer_a_line( buf, line + Y_OFFSET, X_OFFSET, 128 ); |
okano | 1:ce27bc7b44d4 | 26 | oled1.blit565( 0, line, 128, 1, buf ); |
okano | 0:1062142e5718 | 27 | } |
okano | 0:1062142e5718 | 28 | |
okano | 4:5e1828a8e238 | 29 | camera.close_transfer(); |
okano | 0:1062142e5718 | 30 | } |
okano | 0:1062142e5718 | 31 | } |