In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how OpenMV communicates with STM32 MCU, which has certain reference value. Interested friends can refer to it. I hope you can learn a lot after reading this article. Let's take a look at it with you.
Hardware connection
The materials I used are as follows: four-pin IIC OLED,OpenMV (OV7725), STM32F103C8T6 minimum system board, N data lines (OpenMV data cables can only be used officially, other basic can not be used), several DuPont lines.
1.OpenMV side: know UART_RX-P5-UART_TX-P4 from the diagram
2.STM32 side: USART_TX-PA9-USART_RX-PA10
3. Four-pin OLED IIC connection: because SDA-PA2-SCL-PA1 uses analog IIC instead of hardware IIC, you can modify the IO port to control SDA and SCL lines according to individual needs. You only need to simply modify the code.
The TX (RX) of 4.STM32 is connected to the RX (TX) of OpenMV, and the OLED is connected to STM32.
Software code-import sensor, image, time,math,pybfrom pyb import UART,LEDimport jsonimport ustructsensor.reset () sensor.set_pixformat (sensor.RGB565) sensor.set_framesize (sensor.QVGA) sensor.skip_frames (time = 2000) sensor.set_auto_gain (False) # must be turned off for color trackingsensor.set_auto_whitebal (False) # must be turned off for color trackingred_threshold_01= (10,100,127,32,-43 67) clock = time.clock () uart = UART (3Magne 115200) # define serial port 3 variables uart.init (115200, bits=8, parity=None, stop=1) # init with given parametersdef find_max (blobs): # define the function max_size=0 for blob in blobs: if blob.pixels () > max_size: max_blob=blob max_size= blob.pixels () return max_blobdef sending_data (cx,cy,cw) to find the largest color block area Ch): global uart # frame= [0x2C 18pint (cx/0xff), cy%0xff,int (cy/0xff), 0x5B]; # data = bytearray (frame) data = ustruct.pack ("
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.