Random Number

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,865件の閲覧回数
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,163件の閲覧回数
MarkP_
Contributor V

Hi,

how about:

"include <stdlib.h>

 

srand(some seed value);

num = rand();

 

~Mark

元の投稿で解決策を見る

0 件の賞賛
6 返答(返信)
1,163件の閲覧回数
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,163件の閲覧回数
Microfelix
Contributor IV

 

on the datasheet and written the opposite.

 

 

K60 Sub-Family Data Sheet

Hardware random-number generator

 

Maurizio

0 件の賞賛
1,163件の閲覧回数
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,163件の閲覧回数
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,164件の閲覧回数
MarkP_
Contributor V

Hi,

how about:

"include <stdlib.h>

 

srand(some seed value);

num = rand();

 

~Mark

0 件の賞賛
1,163件の閲覧回数
Microfelix
Contributor IV

thanks

0 件の賞賛