mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Improve TV driver resolution, add scaling, and triple buffering
This commit is contained in:
parent
a6237a96b2
commit
1b36b95521
@ -1,15 +1,23 @@
|
|||||||
# TV Example
|
# TV Example
|
||||||
#
|
#
|
||||||
# Note: To run this example you will need a wireless tv shield for your OpenMV Cam.
|
# Note: To run this example you will need a tv or wireless tv shield for your OpenMV Cam.
|
||||||
#
|
#
|
||||||
# The wireless video tv Shield allows you to view your OpenMV Cam's frame buffer on the go.
|
# The wireless video tv Shield allows you to view your OpenMV Cam's frame buffer on the go.
|
||||||
|
#
|
||||||
|
# The TV Shield's resolution is 352x240 (SIF). By default display output is not buffered.
|
||||||
|
# You may enable triple buffering at the cost of 372 KB to make display updates non-blocking.
|
||||||
|
|
||||||
import sensor, image, tv
|
import sensor, image, tv, time
|
||||||
|
|
||||||
sensor.reset() # Initialize the camera sensor.
|
sensor.reset() # Initialize the camera sensor.
|
||||||
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
|
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
|
||||||
sensor.set_framesize(sensor.QQVGA)
|
sensor.set_framesize(sensor.SIF)
|
||||||
tv.init() # Initialize the tv.
|
clock = time.clock()
|
||||||
|
|
||||||
|
tv.init(triple_buffer=False) # Initialize the tv.
|
||||||
tv.channel(8) # For wireless video transmitter shield
|
tv.channel(8) # For wireless video transmitter shield
|
||||||
|
|
||||||
while(True):
|
while(True):
|
||||||
|
clock.tick()
|
||||||
tv.display(sensor.snapshot()) # Take a picture and display the image.
|
tv.display(sensor.snapshot()) # Take a picture and display the image.
|
||||||
|
print(clock.fps())
|
||||||
|
|||||||
@ -248,6 +248,10 @@
|
|||||||
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
|
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
|
||||||
|
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
|
||||||
|
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
||||||
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
||||||
|
|||||||
@ -249,6 +249,10 @@
|
|||||||
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
|
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
|
||||||
|
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
|
||||||
|
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
||||||
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
||||||
|
|||||||
@ -364,6 +364,10 @@
|
|||||||
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
|
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
|
||||||
|
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
|
||||||
|
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
||||||
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
||||||
|
|||||||
@ -402,6 +402,10 @@
|
|||||||
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
|
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
|
||||||
|
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
|
||||||
|
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
||||||
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
||||||
|
|||||||
@ -487,6 +487,10 @@
|
|||||||
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
#define OMV_SPI_LCD_MOSI_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
|
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_14)
|
||||||
|
#define OMV_SPI_LCD_MISO_PORT (GPIOB)
|
||||||
|
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_13)
|
||||||
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
#define OMV_SPI_LCD_SCLK_PORT (GPIOB)
|
||||||
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
||||||
|
|||||||
@ -351,6 +351,10 @@
|
|||||||
#define OMV_SPI_LCD_MOSI_PORT (GPIOC)
|
#define OMV_SPI_LCD_MOSI_PORT (GPIOC)
|
||||||
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_MOSI_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
|
#define OMV_SPI_LCD_MISO_PIN (GPIO_PIN_2)
|
||||||
|
#define OMV_SPI_LCD_MISO_PORT (GPIOC)
|
||||||
|
#define OMV_SPI_LCD_MISO_ALT (GPIO_AF5_SPI2)
|
||||||
|
|
||||||
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_1)
|
#define OMV_SPI_LCD_SCLK_PIN (GPIO_PIN_1)
|
||||||
#define OMV_SPI_LCD_SCLK_PORT (GPIOI)
|
#define OMV_SPI_LCD_SCLK_PORT (GPIOI)
|
||||||
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
#define OMV_SPI_LCD_SCLK_ALT (GPIO_AF5_SPI2)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the OpenMV project.
|
* This file is part of the OpenMV project.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013-2019 Ibrahim Abdelkader <iabdalkader@openmv.io>
|
* Copyright (c) 2013-2020 Ibrahim Abdelkader <iabdalkader@openmv.io>
|
||||||
* Copyright (c) 2013-2019 Kwabena W. Agyeman <kwagyeman@openmv.io>
|
* Copyright (c) 2013-2020 Kwabena W. Agyeman <kwagyeman@openmv.io>
|
||||||
|
* Copyright (c) 2013-2020 Kaizhi Wong <kidswong999@gmail.com>
|
||||||
*
|
*
|
||||||
* This work is licensed under the MIT license, see the file LICENSE for details.
|
* This work is licensed under the MIT license, see the file LICENSE for details.
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user