Issue trying to use NeoPixel Stick

The fett263 prop has a number of do-a-gesture-to-turn-saber-on features.
Are any of these on?
Does the serial monitor say anything interesting when this happens?

i didn’t have the serial monitor up at the time. going forward i’ll have it up and check what gets logged. I’ve tested a bunch of times since my last post and it’s not happening now, it’s very random. Is that saber_fett263_button.h file the only one that has the turn on events? Or are there other files i need to look through?

I’m not sure if you are asking becasue you want these features or if you’re asking because you want to avoid these features, but it looks like the Fett263, BC, Sabersense and SA22C props have some sort of turn-on-with-gesture features.

Sorry, I was asking so i can find all instances of ignition events and wrap them in that condition, or is there a better way of doing that? Simpler? A way to block ignition.

The good news (i think) is that it happened again and this time i had the monitor running. Here is what was logged after ignition

saber is off //inside the saberOff function
unit = 1 vol = 0.50, Playing Kenobi/in/in1.wav
channels: 1 rate: 44100 bits: 16
Saber is OFF: Retracting blade. //motor is running to retract the blade
EVENT: Power-Released#1 millis=144683
EVENT: Power-Released millis=144683
EVENT: Clash millis=144925
EVENT: Stab millis=145046
Ignition.

I added two comments in that log to show you that the program is retracting the blade and the motor is running however those events seem to cause the saber to turn back on which cause the motor to turn the opposite way and extend the balde. Do clash and stab events events ignite the saber if off?

You could try using a simpler prop file, like saber.h
The Fett263 has a STAB_ON feature, so it could cause it to turn on.
I recommend reading the top of the prop file to find all the various *_ON features.

Thanks! i was able to get it working correctly.

Is there a battery level function i can call in the loop that will give me the voltage reading of my battery? I see it in the serial monitor however im having problem locating the function. I tried looking in the forum but no luck. My plan is if the level gets to a certain point like 10v, i’ll have my blade blink.
also, i went with controlling my blade using the external MOSFET module, so im using ditigalWrite HIGH and LOW.

I found this function but its returning 4.5v.

float battery_voltage = battery_monitor.battery();

However, im struggling to figure out how to scale it to read a 12v lipo battery which what im using to power the device. I do have a step down converter for the proffie board 12v - 5v.
Any idea on how i can solve this?

First of all, there is a style for this:

So you can write a style like:

StylePtr<Mix<IfLessThan<BatteryLevel, 3276>, BLINKING_STYLE_HERE, NORMAL_STYLE_HERE>>()

However battery_monitor.battery() and BatteryLevel both measure the voltage the board receives on the BATT+ input, which cannot be higher than 5.5 volts. (Or the board will die.)

However, there are ways… you can use a voltage divider.

Basically, what you need is two resistors, something like a 47k and a 10k. Hook up the 47k to + on the battery, hook up the 10k to - on the battery (or gnd on the board, same thing) and hookup the two resistors together. Then feed the middle point between the resistors to an analog-capable pin on the board.

Now, you can get the voltage by doing:

float V = anlogRead(pin) * 3.3/1024;
float I = V / 10000;
float battery_voltage = I * (10000 + 47000);

Then, if you like, you can modify the battery.h file to just do this for you, and then it will work with BatteryLevel as well.

Thanks, i’ll try doing that with the resistors.

I have RX and TX free, can i use one of them? I see from the chart that they are both ADC capable pins

Yes, you can use either of those.

Ok, thanks.