Random Number

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Random Number

跳至解决方案
2,864 次查看
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 项奖励
1 解答
1,162 次查看
MarkP_
Contributor V

Hi,

how about:

"include <stdlib.h>

 

srand(some seed value);

num = rand();

 

~Mark

在原帖中查看解决方案

0 项奖励
6 回复数
1,162 次查看
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 项奖励
1,162 次查看
Microfelix
Contributor IV

 

on the datasheet and written the opposite.

 

 

K60 Sub-Family Data Sheet

Hardware random-number generator

 

Maurizio

0 项奖励
1,162 次查看
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 项奖励
1,162 次查看
Microfelix
Contributor IV

 

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

 

thanks

 

maurizio

0 项奖励
1,163 次查看
MarkP_
Contributor V

Hi,

how about:

"include <stdlib.h>

 

srand(some seed value);

num = rand();

 

~Mark

0 项奖励
1,162 次查看
Microfelix
Contributor IV

thanks

0 项奖励