Tagged: keil

Snake game on STM32F429-Discovery board 9

Project 02- Snake game for STM32F429-Discovery board

After first FFT project, I’ve decided to make a simple snake game. Basically I’ve made it in Labview first for my partial exam at the university. It looked great so why not port it also to STM32F429-Discovery board which has everything already prepared for us. You just need USB OTG cable and external keyboard to drive snake and you are ready to play. Snake game Features Works on STM32F429-Discovery board Supports external keyboard using USB HID Host stack on STM32 Supports...

HC-SR04 sensor on STM32F4xx device 28

Library 30- Measure distance with HC-SR04 and STM32F4

I have at least 10 HC-SR04 sensors at home so I decided to made a library for it. This sensor can measure distance between 2cm and 4meters. It can produce about 40 measurements per second. His working angle is about 15degrees, On the start, you have to send 10us starting pulse at TRIGGER pin. After that, on ECHO pin high pulse is returned in relation to the distance. Large distance means large high signal. You have to give sensor some time...

L3GD20 3-axis digital gyroscope example 10

Library 28- L3GD20 3-axis digital gyroscope

MEMS sensor L3GD20 is included on STM32F429-Discovery board, so I made a library to use it. This is 3-axis digital gyroscope, so it can measure rotation in X, Y and Z axis. L3GD20 sensor works with SPI communication, or I2C. On Discovery board is connected for SPI mode, SPI5 is used for communication. L3GD20 can be set to work in 3 different full scales: 250, 500 and 2000 dps. Sensor has also possibility to measure temperature, but this is not...

Library 26- Rotary encoder on STM32F4 33

Library 26- Rotary encoder on STM32F4

A rotary encoder, also called a shaft encoder is an electro-mechanical device than converts the angular position or motion of a shaft to an analog or digital. There are 2 types of rotary encoders: Incremental – output indicates just rotation clockwise or counterclockwise Absolute – output indicates current position for encoder For that purpose I made a one simple library. This library works for incremental rotary encoders. It uses an interrupt to handle rotations. On the rotary encoders inside are...

Library 19- Use internal RTC on STM32F4 94

Library 19- Use internal RTC on STM32F4

It’s been some time when I post last library. Next one is internal RTC library. STM32F4xx devices have Real Time Clock (RTC) inside, with support of internal calibrated 32768 Hz oscillator or external (more accurate) 32768 Hz oscillator. RTC peripheral has also backup register support, which means that when you reset MCU, registers are not reset or if power is off and you have battery connected on Vbat pin, clock is still working. RTC can also wakeup MCU from all...

USART Library has been updated! 0

USART Library has been updated!

Today I’ve modified USART library. My library uses receive interrupt. After that, it just save data into cyclic buffer. User actually don’t know when that happen. Today, I was working on some project, where I need to know exact time, when data arrived on USART. For that purpose, I’ve modified USART library. To be able to know exact time when data arrived, you have to add defines in your defines.h file:

Then, you have to manually create a function...