Random Number

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Random Number

Jump to solution
2,827 Views
Microfelix
Contributor IV

 

hello
I can not find a way to general random numbers for MQX 3.7 Kinetis K60.

can you help me
thanks

 

Maurizio Felicioni

0 Kudos
1 Solution
1,125 Views
MarkP_
Contributor V

Hi,

how about:

"include <stdlib.h>

 

srand(some seed value);

num = rand();

 

~Mark

View solution in original post

0 Kudos
6 Replies
1,125 Views
c0170
Senior Contributor III

Hi microfelis,

 

Random Number Generator H/W Accelerator is only for coldfire that's why you can't find it for kinetis.

 

Regards,

MartinK

0 Kudos
1,125 Views
Microfelix
Contributor IV

 

on the datasheet and written the opposite.

 

 

K60 Sub-Family Data Sheet

Hardware random-number generator

 

Maurizio

0 Kudos
1,125 Views
c0170
Senior Contributor III

Yes,you are right it is in datasheet. I was not aware of it. RNG structs are defined for K60 only in MQX 3.7. 

 

Let me ask you what you are really having problems with?

0 Kudos
1,125 Views
Microfelix
Contributor IV

 

I need a function that generates random numbers where I choose the range of values ​​togenerate the number

 

thanks

 

maurizio

0 Kudos
1,126 Views
MarkP_
Contributor V

Hi,

how about:

"include <stdlib.h>

 

srand(some seed value);

num = rand();

 

~Mark

0 Kudos
1,125 Views
Microfelix
Contributor IV

thanks

0 Kudos