MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / generateSequence

Method generateSequence

libraries/SIMON/simon.cpp:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36bool SIMON::generateSequence(uint8_t length, uint8_t minimum, uint8_t maximum)
37{
38 if (length > _maxSize)
39 {
40 _size = 0;
41 return false;
42 }
43 randomSeed(micros());
44 for (uint8_t i = 0; i < length; i++)
45 {
46 _sequence[i] = random(minimum, maximum + 1);
47 }
48 _size = length;
49 return true;
50}
51
52
53uint8_t SIMON::getSequence(uint8_t * array)

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64