Sunday, August 24, 2014

SRF02 ultrasonic sensor with STM32F4-Discovery

This blog has been moved: http://scholtyssek.org/blog/2014/08/24/srf02-ultrasonic-sensor-with-stm32f4-discovery/

The SRF02 Ultrasonic range finder is a ultrasonic distance sensor, which is a transceiver with only one membrane. That's practical, because the sensor is very small and so it is perfect for small sized hardware applications. It detects distances from 16 to 6000 cm. The Sensors needs a 5 V source, so it can be directly connected to many microcontroller. It communicates through serial interface or through i²c bus (also I2C bus called). The following article describes how to connect and use the sensor with a STM32F4 through I2C. The databus is very handy because it needs only two wires (SDA and SCL) for communication. SDA is the data wire and SCL is the clock. Components can be distinguished by a unique I2c address. In this example there are four SRF02 sensors on one bus. The configuration of the address will be described too. The I2C master is a ARM based STM32F4-Discovery (STM32F407VG) controller.

Saturday, August 16, 2014

Xbox360 controller C integration

This blog has been moved: http://scholtyssek.org/blog/2014/08/16/xbox360-controller-c-integration/

Today I have written some simple example code to integrate a Xbox360 controller into a C-based program. It reads the values of the controller axis and the buttons and displays them on the screen. The following picture shows the output of the code:


In this case the buttons "A" and "TL", which is the top left button, were pressed. The project is called xboxControllerClient can be downloaded from my repository at https://code.google.com/p/scholtyssek-blogspot/.