Lepton sensor on the DISCO-F746NG board. Based on the rapberry_pi example code at https://github.com/groupgets/LeptonModule
Dependencies: mbed-src BSP_DISCO_F746NG LCD_DISCO_F746NG
Diff: main.cpp
- Revision:
- 6:5c25567a46df
- Parent:
- 5:998916f0f3ae
- Child:
- 7:c0f3fc856506
--- a/main.cpp Wed Dec 09 12:53:07 2015 +0000 +++ b/main.cpp Wed Dec 09 14:19:28 2015 +0100 @@ -8,6 +8,7 @@ Serial pc(USBTX, USBRX); SPI lepton_spi(SPI_MOSI, SPI_MISO, SPI_SCK); DigitalOut spi_cs(SPI_CS); +LCD_DISCO_F746NG lcd; static uint8_t lepton_buffer[BYTES_PER_PACKET * PACKETS_PER_FRAME]; static uint32_t lepton_image[80][80]; @@ -20,6 +21,7 @@ spi_cs = 0; spi_cs = 1; wait_ms(185); + lcd.Clear(LCD_COLOR_BLACK); } void get_frame(void) @@ -84,11 +86,35 @@ r = colormap_ironblack[3*value]; g = colormap_ironblack[3*value+1]; b = colormap_ironblack[3*value+2]; + + lepton_image[row][column] = 0xFF << 24 | r << 16 | g << 8 | b; } } +void show_image(void) +{ + int column; + int row; + + for(row=0;row<80;row++){ + for(column=0;column<80;column++){ + lcd.SetTextColor(lepton_image[row][column]); + lcd.FillRect(column*4, row*4, 4, 4); + } + } +} + + int main() { pc.printf("Alive\n"); - + setup(); + pc.printf("Up...\n"); + + while(1){ + get_frame(); + create_image(); + show_image(); + pc.printf("."); + } } \ No newline at end of file