Ir ao conteúdo
  • Cadastre-se

Controlar uma Fita Led RGB 6803 pelo computador


Ir à solução Resolvido por .if,

Posts recomendados

Olá a todos! 
Não tenho muito foco na programação mas estou aqui para perguntar aos que dominam tal assunto!

Gostaria de saber se tem como controlar uma fita Led Digital por uma saida COM do computador. Porta Serial seria um exemplo pra tal.
Em Resumo a minha duvida é saber se alguém conhece algum programa que envie pulsos PWM para esta porta ou alguma outra
É mais pelo fetiche de fazer algo diferenciado :) e aproveitar uma que eu ja tenho aqui jogada para não comprar o controlador de novo que é meio caro kakakakakak

Link para o comentário
Compartilhar em outros sites

A fonte ligada na tomada creio que você vai precisar. Que eu saiba nenhuma saída do PC fornece 12v

Dei uns procurada em algo USB, e TB não vi muita solução.as se houver algo pronto, será USB, muitos PCs nem tem mais saída com.

 

Por fim, caso não ache nada, pode arduinar a controladora atual e desenvolver isso. Mas terá que programar tanto a placa, quanto um software de controle no pc ou celular.

 

 

Link para o comentário
Compartilhar em outros sites

  • Membro VIP
  • Solução

Se seu pc tem porta serial, tem paralela. Nesta o acionamento é ttl (0...5V) portanto menos traumático. Num estalo minimalista extremo, basta escrever o dado no registro 0x378 e pronto: ele está no mundo exterior.

for (;;)
{
outport (0x378,0x55);
outport (0x378,0xaa);
}

Taí seu piscaled... seu ponto de partida pra dominar o mundo. Se preferir em nível mais elevado...

http://www.linhadecodigo.com.br/artigo/254/controle-de-dispositivos-externos-atraves-da-porta-paralela-utilizando-csharp.aspx

  • Obrigado 1
  • Amei 1
Link para o comentário
Compartilhar em outros sites

@.if Nossa! Na mosca! Era o que eu estava procurando! Muito Obrigado. Agora é só desenvolver tal façanha :) . Vou Programar em alto nível porque em baixo nível é mais complexo pra mim.

@alexandre.mbm  Em relação a isso eu estou sem a fita aqui no momento. Apenas quando eu voltar do recesso na oficina. mas é uma que possui o ci controlador fora do LED. WS2811. Quando voltar desse recesso eu vou fazer esse projetinho aos poucos, que também me deu muitas ideias.

 

 @Thiago Miotto  Em relação a alimentação, O meu computador é de mesa (desktop) eu posso usar a própria fonte dele que tem 12V

Mais uma vez obrigado a todos que me ajudaram com tal questão, sempre que preciso de ajuda vocês estão aqui pra me salvar! Em breve abro um novo tópico para mostrar o andamento do projeto!

  • Curtir 1
Link para o comentário
Compartilhar em outros sites

@.if o grande problema que vejo aí, é que em led endereçável o programa envia um loop de 1 a n led, qual cor e qual intensidade.

Segue um exemplo extraído da internet.

Não achei a tag code...

 

// NeoPixel test program showing use of the WHITE channel for RGBW

// pixels only (won't look correct on regular RGB NeoPixel strips).

#include <Adafruit_NeoPixel.h>

#ifdef __AVR__

#include <avr/power.h> // Required for 16 MHz Adafruit Trinket

#endif

// Which pin on the Arduino is connected to the NeoPixels?

// On a Trinket or Gemma we suggest changing this to 1:

#define LED_PIN 6

// How many NeoPixels are attached to the Arduino?

#define LED_COUNT 60

// NeoPixel brightness, 0 (min) to 255 (max)

#define BRIGHTNESS 50 // Set BRIGHTNESS to about 1/5 (max = 255)

// Declare our NeoPixel strip object:

Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRBW + NEO_KHZ800);

// Argument 1 = Number of pixels in NeoPixel strip

// Argument 2 = Arduino pin number (most are valid)

// Argument 3 = Pixel type flags, add together as needed:

// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)

// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)

// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)

// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)

// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)

void setup() {

// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.

// Any other board, you can remove this part (but no harm leaving it):

#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)

clock_prescale_set(clock_div_1);

#endif

// END of Trinket-specific code.

strip.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)

strip.show(); // Turn OFF all pixels ASAP

strip.setBrightness(BRIGHTNESS);

}

void loop() {

// Fill along the length of the strip in various colors...

colorWipe(strip.Color(255, 0, 0) , 50); // Red

colorWipe(strip.Color( 0, 255, 0) , 50); // Green

colorWipe(strip.Color( 0, 0, 255) , 50); // Blue

colorWipe(strip.Color( 0, 0, 0, 255), 50); // True white (not RGB white)

whiteOverRainbow(75, 5);

pulseWhite(5);

rainbowFade2White(3, 3, 1);

}

// Fill strip pixels one after another with a color. Strip is NOT cleared

// first; anything there will be covered pixel by pixel. Pass in color

// (as a single 'packed' 32-bit value, which you can get by calling

// strip.Color(red, green, blue) as shown in the loop() function above),

// and a delay time (in milliseconds) between pixels.

void colorWipe(uint32_t color, int wait) {

for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...

strip.setPixelColor(i, color); // Set pixel's color (in RAM)

strip.show(); // Update strip to match

delay(wait); // Pause for a moment

}

}

void whiteOverRainbow(int whiteSpeed, int whiteLength) {

if(whiteLength >= strip.numPixels()) whiteLength = strip.numPixels() - 1;

int head = whiteLength - 1;

int tail = 0;

int loops = 3;

int loopNum = 0;

uint32_t lastTime = millis();

uint32_t firstPixelHue = 0;

for(;;) { // Repeat forever (or until a 'break' or 'return')

for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...

if(((i >= tail) && (i <= head)) || // If between head & tail...

((tail > head) && ((i >= tail) || (i <= head)))) {

strip.setPixelColor(i, strip.Color(0, 0, 0, 255)); // Set white

} else { // else set rainbow

int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());

strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));

}

}

strip.show(); // Update strip with new contents

// There's no delay here, it just runs full-tilt until the timer and

// counter combination below runs out.

firstPixelHue += 40; // Advance just a little along the color wheel

if((millis() - lastTime) > whiteSpeed) { // Time to update head/tail?

if(++head >= strip.numPixels()) { // Advance head, wrap around

head = 0;

if(++loopNum >= loops) return;

}

if(++tail >= strip.numPixels()) { // Advance tail, wrap around

tail = 0;

}

lastTime = millis(); // Save time of last movement

}

}

}

void pulseWhite(uint8_t wait) {

for(int j=0; j<256; j++) { // Ramp up from 0 to 255

// Fill entire strip with white at gamma-corrected brightness level 'j':

strip.fill(strip.Color(0, 0, 0, strip.gamma8(j)));

strip.show();

delay(wait);

}

for(int j=255; j>=0; j--) { // Ramp down from 255 to 0

strip.fill(strip.Color(0, 0, 0, strip.gamma8(j)));

strip.show();

delay(wait);

}

}

void rainbowFade2White(int wait, int rainbowLoops, int whiteLoops) {

int fadeVal=0, fadeMax=100;

// Hue of first pixel runs 'rainbowLoops' complete loops through the color

// wheel. Color wheel has a range of 65536 but it's OK if we roll over, so

// just count from 0 to rainbowLoops*65536, using steps of 256 so we

// advance around the wheel at a decent clip.

for(uint32_t firstPixelHue = 0; firstPixelHue < rainbowLoops*65536;

firstPixelHue += 256) {

for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...

// Offset pixel hue by an amount to make one full revolution of the

// color wheel (range of 65536) along the length of the strip

// (strip.numPixels() steps):

uint32_t pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());

// strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or

// optionally add saturation and value (brightness) (each 0 to 255).

// Here we're using just the three-argument variant, though the

// second value (saturation) is a constant 255.

strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue, 255,

255 * fadeVal / fadeMax)));

}

strip.show();

delay(wait);

if(firstPixelHue < 65536) { // First loop,

if(fadeVal < fadeMax) fadeVal++; // fade in

} else if(firstPixelHue >= ((rainbowLoops-1) * 65536)) { // Last loop,

if(fadeVal > 0) fadeVal--; // fade out

} else {

fadeVal = fadeMax; // Interim loop, make sure fade is at max

}

}

for(int k=0; k<whiteLoops; k++) {

for(int j=0; j<256; j++) { // Ramp up 0 to 255

// Fill entire strip with white at gamma-corrected brightness level 'j':

strip.fill(strip.Color(0, 0, 0, strip.gamma8(j)));

strip.show();

}

delay(1000); // Pause 1 second

for(int j=255; j>=0; j--) { // Ramp down 255 to 0

strip.fill(strip.Color(0, 0, 0, strip.gamma8(j)));

strip.show();

}

}

delay(500); // Pause 1/2 second

}

 

Link para o comentário
Compartilhar em outros sites

  • Membro VIP
1 hora atrás, Ricardo S Ferreira disse:

o grande problema que vejo aí, é que em led endereçável o programa envia um loop de 1 a n led, qual cor e qual intensidade.

Olá @Ricardo S Ferreira . Não vejo um grande problema nisso. Basta você decifrar a função de camada mais baixa que controla o seu led. Provavelmente ela está incluída em '#include <Adafruit_NeoPixel.h>' e pode ser uma das 'strip.xxx'. Também suponho que ela segue algum protocolo conhecido como p.ex. dmx512...

dmx512-8-638.jpg?cb=1443630992

A partir do momento em que você consegue piscar um led num bit de um port, montar a estrutura acima em c é não é totalmente difícil 🙂

Dica: google dmx512 c code 😁

  • Amei 1
Link para o comentário
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisa ser um usuário para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar agora

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...