Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: fill_raw_noise8 from Fastled library returns strange values

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    2

    fill_raw_noise8 from Fastled library returns strange values

    Hello pcrc,

    i have a strange behaviour of the Fastleds fill_raw_noise8 for teensy 3.2.
    It seems to always fill an array with FFs.
    I use teensy 3.2 with FastLED version 3003001 from teensyduino installer (arduino-1.8.10\hardware\teensy\avr\libraries\FastLED\FastL ED.h)
    Since FastLEDs inoise8 function seems to work, maybe the wrong qadd8function is used. On my setup the ide says it runs into the qadd8 function branch "#elif QADD8_ARM_DSP_ASM == 1".

    Sample code:
    #define FASTLED_INTERNAL
    #include "FastLED.h"

    #define LED_COUNT 100

    float time = 0;
    uint8_t* points = (uint8_t*)malloc(sizeof(uint8_t) * LED_COUNT);
    unsigned long lastTick = 0;

    void setup() {
    Serial.begin(115200);
    memset((void*)points, 0, LED_COUNT );
    }

    void loop() {
    unsigned long now = millis();
    unsigned long diff = now - lastTick;

    //fill_raw_noise8(uint8_t * pData, uint8_t num_points, uint8_t octaves, uint16_t x, int scalex, uint16_t time);
    fill_raw_noise8( points, LED_COUNT, 4, 0, 15, (uint16_t) time);

    for (uint16_t i = 0; i < LED_COUNT; i++) {
    Serial.print(points[i]);
    Serial.print(" ");
    }

    Serial.println("");
    Serial.println(diff);
    Serial.println((uint16_t)time);
    time += 0.2 * diff * 10;

    lastTick = now;
    delay(10);
    }



    Producing the following output:
    >255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 >255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
    >12
    >48818

    thanks and kind regards,
    Sven

  2. #2
    Junior Member
    Join Date
    Dec 2019
    Posts
    2
    Hi all,

    ok got it myself.

    the array which should be filled must be zero initialized...

    sorry for the inconvenience.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •