Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
Hi, I've recently put together a setup with a tactile/momentary switch, latching switch, and Arduino Nano using an altered version of the All Effects sketch from this site. However, although the tactile switch works perfectly in toggling from one sketch to another, the latching switch has a peculiar tendency to pause the effect when I power it off (it powers on fine). Of note, the power LED on the Arduino itself shows on and off when I push and release the latching switch, but when in the off position it pauses the sketch. I was told by a friend this shouldn't be happening since the VIN input on the Arduino shouldn't be affected by code. Hopefully someone here can help me, as it would not be very product friendly to have to manually unplug the adapter from the DC jack every time you want to power off :) Thanks in advance!
Here is a "schematic" of my setup to the best of my knowledge:
case 7 : { // Fire - Cooling rate, Sparking rate, speed delay Fire(55,120,15); break; }
// simple bouncingBalls not included, since BouncingColoredBalls can perform this as well as shown below // BouncingColoredBalls - Number of balls, color (red, green, blue) array, continuous // CAUTION: If set to continuous then this effect will never stop!!!
case 8 : { // meteorRain - Color (red, green, blue), meteor size, trail decay, random trail decay (true/false), speed delay meteorRain(0x38,0x00,0xff,10, 64, true, 30); break; } } }
// used by NewKITT void CenterToOutside(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for(int i =((NUM_LEDS-EyeSize)/2); i>=0; i--) { setAll(0,0,0);
// used by NewKITT void OutsideToCenter(byte red, byte green, byte blue, int EyeSize, int SpeedDelay, int ReturnDelay) { for(int i = 0; i<=((NUM_LEDS-EyeSize)/2); i++) { setAll(0,0,0);
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel for (int q=0; q < 3; q++) { for (int i=0; i < NUM_LEDS; i=i+3) { c = Wheel( (i+j) % 255); setPixel(i+q, *c, *(c+1), *(c+2)); //turn every third pixel on } showStrip();
delay(SpeedDelay);
for (int i=0; i < NUM_LEDS; i=i+3) { setPixel(i+q, 0,0,0); //turn every third pixel off } } } }
void Fire(int Cooling, int Sparking, int SpeedDelay) { static byte heat[NUM_LEDS]; int cooldown;
// Step 1. Cool down every cell a little for( int i = 0; i < NUM_LEDS; i++) { cooldown = random(0, ((Cooling * 10) / NUM_LEDS) + 2);
// Set all LEDs to a given color and apply it (visible) void setAll(byte red, byte green, byte blue) { for(int i = 0; i < NUM_LEDS; i++ ) { setPixel(i, red, green, blue); } showStrip(); }
Well it looks like I spoke too soon...all I had to do was move the latching switch to the 5v on the LED strip itself (between the positive on the DC jack and the 5v on the LED strip). A no-brainer for most I'm sure :p Hopefully this helps people anyway!
Things like this happen to all of us haha - but thanks for posting anyway! You're right: someone will run into this as well and find your post helpful 👍 🙂Â
@lakerice Do you understand the reason why you had to make the change that you did?
Originally, you had split the power from the + of the DC power, and placed the latching switch only on the leg that went to the Arduino, which means that when you opened the switch, you powered off the Arduino, but left the LED strip powered on. The LED driver chips on the strips simply latch the last received command, so with the Arduino powered-off, and no additional commands, the strip simply displays whatever the last state was. When you clos the latching switch again, the Arduino reboots, and restarts at the last saved pattern.
When you move the latching switch from the leg that goes to the Arduino, to the leg that goes to the LED strip, opening that switch will now turn off the power to the LEDs, and so the strip will no longer illuminate. Interestingly, the Arduino will still be running, and will still be responding to presses of your momentary switch - you just won't be able to see any results of that. If you close the latching switch again, the LED strip will light up, and the pattern will be whatever the Arduino is currently displaying - it won't revert back to the starting pattern.
If your intention is to power off both the Arduino *and* the LED strip with the latching switch, you need to move it to a slightly different place. Placing the latching switch immediately after the + terminal from your DC power, and then adding the two legs for power to the Arduino and LED strip *after* the latching switch, will accomplish this.
MySolutions.Tech Best DVD/Blu-ray/Video Solutions-Help You to Digitize Your Colorful Life
Find Any File (FAF) [Shareware] Find any File, even when Spotlight fails (eg. your network shares)
WordPress WordPress is one of the best tools for Blogs and Content Management Systems.
VueScan Ultimate scanning tool for Windows, Linux, and macOS, supporting pretty much any scanner, even those no longer supported by your OS. (no scanner drivers needed!)
Links Page These and more of our favorite links can be found on the Links Page.
New Downloads
ConnectMeNow4-v4.0.18-macOS-x86-64.dmgDate: 2024-04-24 - Size: 3.5 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Intel version which works on Intel and Apple Silicon Macs.
ConnectMeNow4-v4.0.18-macOS-arm64.dmgDate: 2024-04-24 - Size: 3 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Apple Silicon version (not suitable for Intel).
MiniWOL2 MacOS (64 bits Apple Silicon)Date: 2023-08-01 - Size: 1.2 MBminiWol is a simple, but effective application to send Wake On LAN to network devices. This is the signed 64 bit MacOS ARM (Apple Silicon) version.
MovieScanner2-2.2.3-Windows-32bit-setup.exeDate: 2023-04-12 - Size: 18.6 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 32 bit Windows version.
MovieScanner2-2.2.2-Linux-GTK-64bits.tar.gzDate: 2023-04-11 - Size: 29.2 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for GTK.
MovieScanner2-2.2.2-Linux-QT5-64bits.tar.gzDate: 2023-04-11 - Size: 29.1 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for QT5.
Downloads Page Find these and more Downloads on the Downloads Page, where you will also find articles references, operating system requirements and categories.
Amazon Ads
Support us by doing your shopping at Amazon.com, either click the link, or click one of the links below …
You can also sponsor us through these Amazon offerings:
Please consider disabling your ad blocker for our website.We rely on these ads to be able to run our website.You can of course support us in other ways (see Support Us on the left).