This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • TI Thinks Resolved

CCS/LAUNCHXL-CC1350: RANDOM SEQUENCE GENERATOR

Part Number: LAUNCHXL-CC1350

Tool/software: Code Composer Studio

Hiiii, i am working with packet TX example . I want to transmit a random sequence of 1 to 100 every time. By rand() i am able to generate random numbers. but i want to generate A random sequence between 1 to 100 which should contain all values between 1 to 100. no number should duplicate in a sequence. thankuu

  • Hi,

    Are you asking how to use rand() and normalize between 1 and 100? If so, there are plenty of discussions around on the internet - you can search for something like "how to normalize rand()". This would give you a normalized range where you can apply weight values to adjust to the range you want.

    --Cheers
  • In reply to 176-671:

    hi . i want to generate a random sequence of 100 entries which contains numbers from 1 to 100. and no number should appear twice means each number between 1 to 100 should appears once in a sequence. thnakuuu

  • In reply to vikas kumar24:

    Hi,

    As I hinted before, this is a question about a specific algorithm and not about Code Composer Studio or other tools from TI. You will find plenty of suggestions to accomplish this around on the internet.

    --Cheers
  • In reply to vikas kumar24:

    The C programming faq is a great resource, and a great book.

    c-faq.com/.../shuffle.html

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.