Page 1 of 1

Crazyflie proximity sensor

Posted: Wed Nov 25, 2015 5:54 am
by mostheblu
Hi every one I am new develop in crazyflie. I try to add proximity sensor to crazyflie 2.0. I follow this tutourial
https://cfusting.wordpress.com/2013/07/ ... tric-data/
https://cfusting.wordpress.com/2013/07/ ... ty-sensor/

I already connect LV-MaxSonar-EZ0 with crazyflie, and flash the new firmware binary to crazyflie but my problem is I don't know how to to add parameter to this one because it have error occur when I try to build the project in eclipse the error is in file" targets.mk" I don't know what this file do.
Has anyone try to do this project before can you help me thak you .

Re: Crazyflie proximity sensor

Posted: Wed Nov 25, 2015 10:00 am
by arnaud
Hi,

This work was done on Crazyflie 1 and so the code is pretty old and will not work on Crazyflie 2.0, you will have to port the driver to Crazyflie 2.0.

The easiest way to add code to the Crazyflie 2.0 is to add it in the new deck api framework: https://wiki.bitcraze.io/doc:crazyflie: ... mware:deck

Re: Crazyflie proximity sensor

Posted: Wed Dec 02, 2015 11:50 am
by mostheblu
Thank you very much, I will try this method.
By the way Im not sure about the variable GPIO to connect sensor
+5 -> pin 20
GND -> pin 19
AN -> pin 14
It correct ? because I see the GPIO parameter in crazyflie2.0 firmware source code have only gpio_0 to gpio_15 how did I know which parameter I can use to connect sensor with crazyflie ?

Re: Crazyflie proximity sensor

Posted: Tue Dec 08, 2015 10:01 am
by arnaud
Crazyflie is a 3V board, you should only connect 3-3.3V electronic to it.

You can find the pinout of the expansion port there: https://wiki.bitcraze.io/projects:crazy ... ort_pinout

you will have to connect 3V, GND, and one analog input. The deck API contains the analogRead function to read the value of analog inputs.