Profile cover photo
Profile photo
Kyle Halvorson
About
Kyle's posts

Is there a way to set the milliamp cap for each pin? I only want to limit power consumption on two pins instead of globally.

Does anyone know where I can find an example of a sketch that has a demonstration on how to have one program work on two different lengths of strips on different pins? For example I want to know the best way to get a "dot" to move from one strip to another just through programming, not because they're physically wired together. Say 45 LEDs on pin 10 and 120 LEDs on pin 9, but you want the program to use them as one 165 LED strip.

I don't remember where I found this but I like the way it looks. What would be the best way to keep the pattern doing the same thing and remove the delay? Trying to integrate a button to change variables but it won't work because the delay is messing with the reading of the button. This is just the raw program without any button integration.

#include "FastLED.h"

// How many leds in your strip?
#define NUM_LEDS 120

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN
#define DATA_PIN 10
#define CLOCK_PIN 13

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() {
Serial.begin(57600);
Serial.println("resetting");
LEDS.addLeds<WS2812B,DATA_PIN,GRB>(leds,NUM_LEDS);
LEDS.setBrightness(255);
}

void loop() {
static uint8_t hue = 0;
// First slide the led in one direction
for(int i = 0; i < NUM_LEDS; i++) {
// Set the i'th led to red
leds[i] = CHSV((hue++ + 20), 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); }
// Wait a little bit before we loop around and do it again
delay(15);
}

// Now go in the other direction.
for(int i = (NUM_LEDS); i >= 0; i--) {
// Set the i'th led to red
leds[i] = CHSV((hue++ + 20), 255, 255);
// Show the leds
FastLED.show();
// now that we've shown the leds, reset the i'th led to black
// leds[i] = CRGB::Black;
for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); }
// Wait a little bit before we loop around and do it again
delay(2);
}
}

Post has attachment
Still need to organize my tools and other crap on the floor, but this is officially my LED/other Arduino project work station!! Finally have my own space to do my thing.
Photo

I just finished building a cheap computer just for browsing the internet and uploading Arduino programs. My program I've been working on for the past few weeks works flawlessly with my old laptop and has no issues at all. But with my new PC the program freezes at the same spot every time it gets to a certain pattern. I have the exact same program open on both computers at the same time and just move the USB cable, hit upload and it works on the laptop but not on the new PC.. on the PC it won't send data to the serial monitor after the certain problematic pattern and just sits there frozen once it gets to that pattern. But with my laptop it's perfectly fine. Any ideas?

Just confirming, FastLED works with the atmega32u4 correct? Any downsides?

Post has attachment
Ok who was it?? Haha Director park In Portland Oregon.

I'm in need of a bit of assistance, i'm messing around with a HEAVILY modified Demoreel100 based sketch that I'm working on integrating a button into, this does exactly what I want it to do for the most part, right now it changes patterns every 15 seconds like I want it to, it changes patterns with the press of the button, and it stores gCurrentPatternNumber to the eeprom when I hold the button for 1 second just like it should. I'm trying to get it to "ignore" the nextPattern(); loop every 15 seconds but only when there wasn't a "longpress" event. I basically want it to cycle through my patterns normally every 15 seconds and also advance to the next pattern when I press the button, then "lock" the current pattern that it's on when I press and hold the button for 1 second. It's probably as simple as an "If/Else" statement but I'm having trouble figuring out where to put it and what it needs to do. Can anyone give me some insight? Any help is greatly appreciated.


void loop()
{
gPatterns[gCurrentPatternNumber](); // Call the current pattern function once, updating the 'leds' array
readbutton();
FastLED.show(); // send the 'leds' array out to the actual LED strip
// do some periodic updates
EVERY_N_MILLISECONDS( 15 ) { gHue++; } // slowly cycle the "base color" through the rainbow

EVERY_N_SECONDS( 15 ) { nextPattern();} // change patterns every N seconds


} //loop()



void nextPattern()
{
// add one to the current pattern number, and wrap around at the end
gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);
Serial.println(gCurrentPatternNumber);

}//nextPattern()

void readbutton() { // Read the button and increase the mode.

myBtn.read();

if(myBtn.wasReleased()) {
if (longpress==1) {
EEPROM.write(eepaddress, gCurrentPatternNumber);
Serial.print("Writing: ");
} else {
gCurrentPatternNumber = gCurrentPatternNumber > maxMode-1 ? 0 : gCurrentPatternNumber+1; // Reset to 0 only during a mode change.
}
longpress = 0;
Serial.println(gCurrentPatternNumber);
}

if(myBtn.pressedFor(1000)) {
longpress = 1;
}

}//readbutton()


Post has attachment
Looking for these connectors, I need male and female, 3 and 4 pin. What are they called and where can I find them? Preferably uncrimped pins would be nice so I can crimp them myself and not have to solder and use heat shrink. Links to a website are greatly appreciated, Thanks in advance. 
Photo

Post has attachment
I have purchased "The King". Anyone who has visited the Wilsonville Oregon Fry's Electronics will recognize it. Will soon be a showcase of my LED Business I'm starting up. Really excited about this! https://m.facebook.com/KTECHLEDS/
Photo
Wait while more posts are being loaded