STAR Firmware by JonnyC - Source Code and Explanation

Momentary switch driver. Switch pin soldered to a contact ring for the piston.
Do you still have the original contact ring? What diameter driver would fit?

I do still have all the parts including the mostly stripped driver board and contact ring. A 15DD would fit with just a tiny bit of sanding (~.3mm to big, stock driver is exactly 14.5mm, the 15DD V2’s I have are 14.85mm).

Do I understand how PD works? The batt is always in contact and pushing the piston in it pretty much just a momentary switch? Or does the piston actually make/break contact?

I don’t actually have a piston light but if it would have function as just a momentary switch. Otherwise the it couldn’t remain lit when the piston was not depressed.

Could you take pics of the ring & driver? I found some pictures on cpf here but I’m not clear on how the ring “floats” as nightcore puts it.

Could be like a momentary switch, or a potentiometer, or a switch that isn't momentary. How many positions does it have? I can think of a few ways to make it work...

I guess I’m presuming the whole driver doesn’t float & use an actual switch on the top of the driver. Haven’t found a picture of the driver’s other side.

Im not sure anymore, dont remember, its either 2 positions (off and on) or possible just one position it always comes back to, as you know I’m really busy this weekend in the middle of another screw up project. when I get a chance I’ll watch a couple youtube videos to see exactly how it works and come back to this project in a few days. I think I had this light all of 3 weeks before I broke it so its in great shape for a host if I can get it going and the driver should be a perfect fit.

Here is a pic of my assembled pill removed from the body. From what it looks like the sprung ground ring makes contact with the driver’s ground ring to switch it.

Piston on top-

Found some useful pics. Nitecore D11.2 I see the contact ring has its own spring. I’m thinking it snaps on to hold in place.

Opps. Your quick.

I would think thats not actually the driver’s ground ring its making contact with but instead a switch contact ring. Driver would need a ground connection that isn’t momentary. When “off” a driver would go into very low power sleep.

When you have time remove the driver and see if there is a ground conection on the other side. Might be a press fit connection or an extra wire.

Sadly the other side of the driver is non existent anymore but that makes sense. So a wire would go from star 4 (assuming that’s what you have it set for) to that bottom outer ring and the piston grounding that ring would be a short/long press?

That seems doable.

I need to duplicate the stock UI on the Solarforce Z1/Z2, meaning: EVERY half-press changes mode every time no matter how long it's been on; and, it only resets back to hi mode after being off for 1-2 seconds. Is the off-time version, with memory disabled, the one to use for that?

Yup, off-time with no memory.

I dont know the answer to your question but that is one of my very few complaints about the current versions, this would be awesome!

That's a lot of crap on a tiny little board, but it works! Used levels of 4-20-90-255, fast PWM, no memory. Moon could probably be a little lower, but it has pretty good spacing (plus, to reflash it again I have to remove the jumper wires, I think this one will stay as-is).

1uF/0805/X7R/5%, 100 for $4.99: http://www.ebay.com/itm/181283883536 :O

Glad it worked! I've probably said it before, but now that I've gone off-time, I can't go back.

Would you like a custom “static” build where you have HI>LO+moon, and mem off as stock (no stars soldered)
Pretty much S┴∀ɹ ΛƖ˙Ɩ? [STAR V1.1 flipped] :smiley:

I build a few custom like this with JohnnyC showing me how…(well minus the moon on but can whip em up in a few minutes once I get home from work)

I also have a 60 second quick timeout for those “barn burners” so they come on turbo but after a minute throttle back as to not overheat

P.S. FANTASTIC solder work there…awesome!

One of the issue for the 4 stars wiring is that because PB0 (Pin5) was connected to ground. Every time you re-flash the program on the chip, you must remove the jumper first.

I think I got the defaults switched around... well, it's got moon & high-to-low, I haven't tried it to see if it goes back to normal with the stars grounded.

}

inline void check_stars() {
// Load up the modes based on stars
// Always load up the modes array in order of lowest to highest mode
// 0 being low for soldered, 1 for pulled-up for not soldered
// Moon
#ifdef MODE_MOON
if ((PINB & (1 << STAR2_PIN)) == 1) {
modes[mode_cnt++] = MODE_MOON;
}
#endif
#ifdef MODE_LOW
modes[mode_cnt++] = MODE_LOW;
#endif
#ifdef MODE_MED
modes[mode_cnt++] = MODE_MED;
#endif
#ifdef MODE_HIGH
modes[mode_cnt++] = MODE_HIGH;
#endif
#ifdef MODE_TURBO
modes[mode_cnt++] = MODE_TURBO;
#endif
if ((PINB & (1 << STAR3_PIN)) == 0) {
// High to Low
mode_dir = 1;
} else {
mode_dir = -1;
}
}

Per Johnny you can either change the

(1 << STAR2_PIN)) == 1) 

== to a > or flip the mode_dir 1 and -1