CF2.0 Led ring expansion: how to program?

Firmware/software/electronics/mechanics
Post Reply
eric_castro
Beginner
Posts: 8
Joined: Wed Dec 31, 2014 3:19 pm

CF2.0 Led ring expansion: how to program?

Post by eric_castro »

I just received some spare parts and the neopixel led ring for my CF 2.0

It turns on fine, it works, but with latest firmware it is plain white light without any effect.

I tried using the client for OSX, but it only works with the Crazyradio (which should be arriving soon, too). It doesn't support BLE yet.

However, I didn't see any neopixel settings. No neopixel settings in the iPhone app either.

The only thing I saw is a branch on github named "neopixe_dev", I'm a dev myself and everything but I'm not exactly sure where to start just to test some light effects, that I can later program with my own code, etc

Any wiki/tutorial out there?

Thanks
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CF2.0 Led ring expansion: how to program?

Post by chad »

eric_castro wrote:but with latest firmware it is plain white light without any effect.
That's the default effect.
eric_castro wrote:I tried using the client for OSX, but it only works with the Crazyradio (which should be arriving soon, too). It doesn't support BLE yet. However, I didn't see any neopixel settings.
You can only change the current LED ring effect by changing the parameter for "ring.effect" in the firmware (either at run time or by setting the default value at compile time). At run time, this parameter is only accessible through cfclient's "Parameters" tab. You can change it from your controller if you use a branch of the cfclient. Read this thread entry to find out more. If you change the default in the firmware you'll need to re-flash the CF of course. Without the Crazyradio you can do this over USB with DFU.

AFAIK, Mac and PCs don't support BLE communication with the Crazyflie (you need the Crazyradio).
eric_castro wrote:No neopixel settings in the iPhone app either.
Yep. Unfortunately not. If you have some CocoaTouch and iOS dev experience maybe you can add the functionality and give Bitcraze a pull request...?
eric_castro wrote:The only thing I saw is a branch on github named "neopixe_dev", I'm a dev myself and everything but I'm not exactly sure where to start just to test some light effects, that I can later program with my own code, etc
The neopixel_dev branch is actually for the CF1.0 when Bitcraze did a mod using Adafruit's NeoPixel ring. You can find the relevant files for the CF2.0 in the Crazyflie firmware repository (on the crazyflie2 branch). The effects code is in neopixelring.c.
eric_castro wrote:Any wiki/tutorial out there?
I don't think so but you can find some info on the effects in my blog entries about the NeoPixel ring mod on CF1.0. The code is still applicable to CF2.0... There's also some info about what I changed to add controller support to the client (that might help if you want to implement it in the iOS client app - though most of it is not directly applicable).
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
eric_castro
Beginner
Posts: 8
Joined: Wed Dec 31, 2014 3:19 pm

Re: CF2.0 Led ring expansion: how to program?

Post by eric_castro »

Yep I have a vast iOS dev experience so I will investigate how I can make the iOS client interact with the leds.

I have yet to find a way to do some stable flying first - I had this for a couple weeks only and it's almost impossible with the iphone app. I'm hoping the crazy radio will solve this issue.

Once I get there I will start trying your suggestions.

Thanks a lot!
alex
Expert
Posts: 137
Joined: Mon Feb 18, 2013 11:36 am
Location: Germany

Re: CF2.0 Led ring expansion: how to program?

Post by alex »

eric_castro wrote:Yep I have a vast iOS dev experience so I will investigate how I can make the iOS client interact with the leds.

I have yet to find a way to do some stable flying first - I had this for a couple weeks only and it's almost impossible with the iphone app. I'm hoping the crazy radio will solve this issue.

Once I get there I will start trying your suggestions.

Thanks a lot!
Maybe this is due to unbalanced propellers, see here:

http://wiki.bitcraze.se/projects:crazyf ... and_tricks

The battery position is also essential for a stable flight. If balanced, the performance and stability in the air is really good. Even without moving the fingers on your iPhone the CF stays at the same point in the air. In addition, try to only roll your finger tips slightly around the stable position on the touch screen in the beginning instead of swiping. This gives you way more control without a stick-slip effect on the surface of your touch device.
jtbonhomme
Beginner
Posts: 1
Joined: Sun Jan 18, 2015 1:56 pm

Re: CF2.0 Led ring expansion: how to program?

Post by jtbonhomme »

Hello,

I also experiment troubles in flying my CF2 in a "stable" way. I follow tips to balance propellers, but my quad always goes backward when I set thrust (crazyradio on Mac Os x, with a PS3 controller w/t USB).

I also followed Chad trick to twist the battery cables and make it go under the pcb to avoid any perturbation.

I tried to play with advanced settings and adjust offsets for Roll and Pitch in the client, but it is still difficult to take off vertically and maintain altitude (althold button only keep on going up to the ceiling).

I read a post in which someone said one could damage motor rotors while adjusting propellers, hope I did not in this case.
I also could post a video if it may help ...

If anyone had any clue to experiment pleasant flight, I am aware of anything :)

Take care,
JT
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CF2.0 Led ring expansion: how to program?

Post by chad »

Hi JT,

You're on Mac OS X with a PS3 controller... Have you changed the controller config in your cfclient to use one of the PS3 mappings instead of the OSX Generic mapping? Check the Input Device menu...
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
knuckles904
Beginner
Posts: 7
Joined: Thu Jan 29, 2015 6:10 am

Re: CF2.0 Led ring expansion: how to program?

Post by knuckles904 »

You wouldn't be able to point me in the direction of where the default param values are set in the crazyflie firmware (aka where is ring.effect=7 set as default)? Just digging into the various codebases and it's taking some time to get my bearings.

Thanks!
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: CF2.0 Led ring expansion: how to program?

Post by chad »

knuckles904 wrote:You wouldn't be able to point me in the direction of where the default param values are set in the crazyflie firmware (aka where is ring.effect=7 set as default)? Just digging into the various codebases and it's taking some time to get my bearings.

Thanks!
From earlier in this thread:
chad wrote:The effects code is in neopixelring.c
It's set to 9 now...

Code: Select all

static uint32_t effect = 9;
Hope that helps!! :)
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
Post Reply