sharp gp2y0a21yk0f

Firmware/software/electronics/mechanics
mannaris
Beginner
Posts: 23
Joined: Tue Oct 13, 2015 6:05 pm

sharp gp2y0a21yk0f

Post by mannaris »

Hello,
want to ask if its possible to connect the crazyflie 2.0 with the sensor(sharp gp2y0a21yk0f) and what i have to do?

thank you very much!

mannaris
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: sharp gp2y0a21yk0f

Post by arnaud »

Hi,

Yes it would be possible to interface this sensor.

You have to connect the sensor to the deck port: https://wiki.bitcraze.io/projects:crazy ... ort_pinout

It should be just power and output of the sensor to an analog input.

Then you have to create a deck driver: https://wiki.bitcraze.io/doc:crazyflie: ... mware:deck

There is an analog API, though not yet documented: https://github.com/bitcraze/crazyflie-f ... k_analog.h (it is very similar to the arduino analog api).

This should be enough to get you started, do not hesitate if you have further questions.
mannaris
Beginner
Posts: 23
Joined: Tue Oct 13, 2015 6:05 pm

Re: sharp gp2y0a21yk0f

Post by mannaris »

hi,
thank you very much for your help!
I have connected the sensor to the deck port and soldered it to an analog input.
Now I have to create this deck driver, but i dont understand where i have to insert it and how i can change the firmware.
And after this the data of the sensor should be shown somewhere.
It would be great, if someone can answer these question. i am very grateful for any help!

Thanks,
mannaris
Che.
Member
Posts: 62
Joined: Tue Jul 28, 2015 1:47 pm
Location: Germany

Re: sharp gp2y0a21yk0f

Post by Che. »

hi, did you already download the virtual box provided by bitcraze? you can download it on their homepage.
this is a good startingpoint, you can browse and edit the whole firmware and flash it from there. take a look on the wikipages from bitcraze.

i hope that helps you past the first days.

greets, che
mannaris
Beginner
Posts: 23
Joined: Tue Oct 13, 2015 6:05 pm

Re: sharp gp2y0a21yk0f

Post by mannaris »

hi, yes thank you for that tipp. I have downloaded it and have found the function to flash it with the crazyradio, but i cant find the place where i have to change the firmware for installing the deck driver. I want to add the driver in a way that i can add the sensor output as a parameter which i can see in the client.
"To compile the driver, place it in deck/drivers/src/ and add it to the Makefile: "
Unfortunately i am not able to find these folders.
I hope for any help and i am so grateful for all answers.
mannaris
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: sharp gp2y0a21yk0f

Post by arnaud »

Hi, Sounds like you did not pull the latest version of the project and moved to the "master" branch. The folders are in the latest versions.

If you want to see the sensor output it is better to use a log variable, it can be added easily for example: https://github.com/bitcraze/crazyflie-f ... zer.c#L638 then you will be able to plot the values in the client.
mannaris
Beginner
Posts: 23
Joined: Tue Oct 13, 2015 6:05 pm

Re: sharp gp2y0a21yk0f

Post by mannaris »

I cant find the source code in the virtual box.the folders arent the same as in the description. I download it two times and upgrade all services. hope its my bad and anyone can tell me what i have to do.
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: sharp gp2y0a21yk0f

Post by arnaud »

Are you sure the git repos in the virtual machine is in the master branch?
anasios
Beginner
Posts: 14
Joined: Fri Nov 06, 2015 3:41 pm

Re: sharp gp2y0a21yk0f

Post by anasios »

mannaris
Beginner
Posts: 23
Joined: Tue Oct 13, 2015 6:05 pm

Re: sharp gp2y0a21yk0f

Post by mannaris »

First i want to say thank you to anasios for the link.

Then i want to ask 3 questions:

1. I have the crazyflie2. How is the firmware called? Is it crazyflie firmware or is it crazyflie2-nrf-firmware?
2. can I use the driver from anasios for the crazyflie2 and my sensor(analog)?
3. I dont find the place where I have to put the driver. The wiki says : "To compile the driver, place it in deck/drivers/src/ and add it to the Makefile"
But im not able to find these folders. "Hi, Sounds like you did not pull the latest version of the project and moved to the "master" branch. The folders are in the latest versions." i dont know what you mean with "the master branch".
I would be very happy, if anyone can give me a description where i have to insert this driver, because i havent any idea what to do.
https://www.youtube.com/watch?v=chWrNh73YBw can i do it in this way? i only have to know where i have to insert the code, bacause the description is for the crazyflie 1 or is it the same?

very gratefull for any help.

mannaris
Post Reply