PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

randomf_example.ino 344B

3 jaren geleden
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. }