This demo is designed to run on an STM32 microcontroller and some additional hardware, detailed below:
- An STM32F746G Discovery kit
- A 3.3V to 5V level shifter such as Texas Instrument's TXB0104 which can be found on a breakout board for easier use, such as: SparkFun Voltage-Level Translator Breakout
- A NeoPixel WS2812 or compatible LED Strip; such as: SparkFun LED RGB Strip
- A breadboard, such as: SparkFun Translucent Breadboard
- A 5V power supply
Connect the components as shown in the schematic below:
We recommend including a capacitor across the LED strip power supply.
- Connect the STM32F746G-DISCO board via the ST-LINK USB port to your Mac.
- Make sure you have a recent nightly Swift toolchain that has Embedded Swift support.
- Install the
stlink
(https://github.com/stlink-org/stlink) command line tools, e.g. viabrew install stlink
. - Build and upload the program to flash memory of the STM:
$ cd stm32-neopixel
$ export TOOLCHAINS='<toolchain-identifier>'
$ make
$ st-flash --reset write .build/release/Application.bin 0x08000000
- The LED strip should light up and slowly animate a color gradient.