Template: TCS34725 Color Sensor STM32 Guide

From Waveshare Wiki
Jump to: navigation, search

The STM32 examples are based on the STM32F103RBT6 and the STM32H743. The connection provided below is based on the STM32F103RB. If you need to use other STM32 boards, you may need to change the hardware connection and port the code yourself.

STM32

Hardware Connection

Sensor STM32 Description
VCC 3.3V Power input
GMD GND Power ground
SDA PB9 I2C data input
SCL PB8 I2C clock pin
INT PB4 Interrupt output (open drain output)
LED PB10 Light emitting diode
TCS34725 STM32 2.jpg

Examples

The examples are developed based on the HAL libraries. Download the Demo codes archive to your PC. Unzip and find the STM32 project from TCS34725_Color_Sensor_code\STM32\XNUCLEO-F103RB\MDK-ARM.

  • Open the TCS34725_Color_Sensoc.uvprojx file by Keil.
  • Build and the project.
  • Program the project to your STM32 board.
  • Connect the UART1 of your STM32 board to the PC and check the serial data with SSCOM software.
TCS34725 STM32 1.jpg