Crazyflie proximity sensor

Firmware/software/electronics/mechanics
Post Reply
mostheblu
Beginner
Posts: 2
Joined: Wed Nov 25, 2015 5:27 am

Crazyflie proximity sensor

Post 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 .
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie proximity sensor

Post 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
mostheblu
Beginner
Posts: 2
Joined: Wed Nov 25, 2015 5:27 am

Re: Crazyflie proximity sensor

Post 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 ?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie proximity sensor

Post 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.
Post Reply