Closed jabulonboaz closed 6 years ago
I don't know about additional LEDs, but maybe it is caused LED control data haven't been transmitted completely because an array size is small.
If you modify "led_rgb_data_2Mic[8][12]" to "led_rgb_data_2Mic[8][36], it may work well.
I tried it did not work. Any other suggestions please?
Unfortunately, I can't give any advice for your customized device.
Why don't you ask Seeed?
Sure i can ask them but i though to ask you first as the code has your copyright. "Copyright 2018 dimeiza. All Rights Reserved." So since you wrote the code i thought you would know which variable to change to increase the LED number. So far i have only found seed's code for Google Assistant LED patern and i am using that "pixel.py" and it has a variable LEDNUM so i change that and it works. But to create Alexa LED patern i am using your code.
Hello Dimeiza
For the respeker 2 mic hat, where in your code can i change the number of LEDs from 3 to 9 please? I am using a Respeaker 2 mic hat and I have added a strip of 9 additional APA102 LEDs but only 3 of them light up (3 on the Respeaker board and 3 on my LED strip). I tested the LED strip it works for sure.
I tried to modify your code like this but i cant make all 9 LEDs to light up. Please refer to the line bellow uint8_t led_rgb_data_2Mic[8][12] = {
/*
include
include
include
include
include
include
include <sys/ioctl.h>
include <linux/types.h>
include <linux/spi/spidev.h>
include
define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
static void pabort(const char *s) { perror(s); abort(); }
static const char *device = "/dev/spidev0.1"; static uint8_t mode; static uint8_t bits = 8; static uint32_t speed = 800000; static uint16_t delay;
struct LEDPatternRecord { char *LEDPatternName; int LEDPatternIndex; };
struct MicHatRecord { char *MicName; int MicID; };
static const struct MicHatRecord MicList[] = { { "2mic", 0 }, { "4mic", 1 }, };
static const struct LEDPatternRecord LEDPatternList[] = { {"LED_TURN_OFF",0,}, {"ALEXA_LISTENING",1}, {"ALEXA_THINKING",2}, {"ALEXA_SPEAKING",3},
};
uint8_t led_rgb_data_4Mic[8][48] = {
};
**uint8_t led_rgb_data_2Mic[8][12] = {
};
uint8_t startFrame[] = { 0x00, 0x00, 0x00, 0x00 };
uint8_t endFrame[] = { 0x00,0x00 };
static int getMicID(char *MicName){
} static int getLEDPatternIndex(char *LEDPatternName){
}
static int sendSPI(int fd,unsigned char *sendData,int length){
}
static void controlLED(int hatID ,int pattern){
}
static const struct option lopts[] = { { "device", 1, 0, 'D' }, { NULL, 0, 0, 0 }, };
static void print_usage(const char *prog) { printf("Usage: %s [-D] pattern-name\n", prog); puts("-D --device device to use (2mic or 4mic, default:2mic)");
}
int main(int argc, char *argv[]) { int pattern = 0; int hatID = 3;
}