Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)
- Legyártottam a kód inkriminált részét. Pont ugyan azt teszi amit a sajátom.
- Nem akartam széjjel tutujgatni a sajátomat.
- #include <FastLED.h>
- #define LED_PIN 2
- #define NUM_LEDS 60
- #define BRIGHTNESS 255
- #define LED_TYPE WS2812B
- #define COLOR_ORDER GRB
- CRGB leds[NUM_LEDS];
- void IRAM_ATTR onTimer(){ //körbe forgatja a ledek tartalmát
- leds[59] = leds[40];
- leds[39] = leds[20];
- leds[19] = leds[0];
- for(int dot = 0; dot < 20; dot++) {
- leds[dot+40] = leds[dot+41];
- leds[dot+20] = leds[dot+21];
- leds[dot] = leds[dot+1];
- FastLED.show(); //megjeleníti.
- }
- }
- void setup() {
- hw_timer_t * timer = NULL;
- // put your setup code here, to run once:
- /* Use 1st timer of 4 */
- /* 1 tick take 1/(80MHZ/80) = 1us so we set divider 80 and count up */
- timer = timerBegin(0, 80, true);
- /* Attach onTimer function to our timer */
- timerAttachInterrupt(timer, &onTimer, true);
- /* Set alarm to call onTimer function every second 1 tick is 1us
- => 1 second is 1000000us */
- /* Repeat the alarm (third parameter) */
- timerAlarmWrite(timer, 5000, true); //100Hz
- /* Start an alarm */
- timerAlarmEnable(timer);
- FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
- FastLED.setBrightness( BRIGHTNESS );
- for (int dot=0;dot <= 10; dot ++) { //sárga és fekete szineket állít be.
- leds[dot] = CRGB::Orange;
- leds[dot+10] = CRGB::Black;
- leds[dot+20] = CRGB::Orange;
- leds[dot+30] = CRGB::Black;
- leds[dot+40] = CRGB::Orange;
- leds[dot+50] = CRGB::Black;
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
Advertisement
Add Comment
Please, Sign In to add comment