-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (24 loc) · 810 Bytes
/
main.cpp
File metadata and controls
29 lines (24 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// #include "sam3.h"
#include "TrueRandom.hpp"
#include "hwlib.hpp" //No need to include sam3.h if using hwlib.
/** Demonstrates 3 different ways the functions can be used to generate differnt numbers
* @return None.
*/
int main() {
for (;;) {
hwlib::cout << "random 32 Bit unsigned int: " << hwlib::endl;
uint_fast32_t x = trueRandom();
hwlib::cout << x << hwlib::endl;
hwlib::cout
<< "random values between 0 and 100 if no parameters are given: "
<< hwlib::endl;
uint_fast32_t y = RandomRange();
hwlib::cout << y << hwlib::endl;
hwlib::cout
<< "random values between given minimum and maximum (666 and 888): "
<< hwlib::endl;
uint_fast32_t z = RandomRange(666, 888);
hwlib::cout << z << hwlib::endl;
hwlib::wait_ms(500);
}
}