PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021
  1. #include <Entropy.h>
  2. void setup()
  3. {
  4. float random_num;
  5. Entropy.Initialize();
  6. // Obtain a random floating [0,1)
  7. random_num = Entropy.randomf(); // return a 0 or a 1
  8. // Obtain a random float [0,10)
  9. random_num = Entropy.randomf(10);
  10. // Obtain a random float [101. 200)
  11. random_num = Entropy.randomf(101,200);
  12. }
  13. void loop()
  14. {
  15. }