We built low power electronic dice which only needs a power supply when showing a number. No gaming, no power consumption.
The controller is doing two steps after a power up:1) generate a random number2) display it
Arduino shows us a nice code example getting a random number:
// print a random number from 1 to 6
randNumber = random(1, 5);
Unfortunately calling this after a power up with a standard microcontroller like an Arduino or one of our XMC microcontrollers has one big disadvantage -> it shows the same "random" number every time.To overcome this issue we generate the random number with one of our security chips. The Optiga Trust M uses some cryptographic algorithm to generate a random number that is really random.
ret = trustM.getRandom(8, rnd);
XMC2Go P2.11 -> SCL OPTIGA ShieldXMC2Go P2.10 -> SDA OPTIGA Shield
XMC2Go P0.14 -> Clock LED ShieldXMC2Go P0.15 -> Data LED Shield
Download the OPTIGA Trust M library here, flash theproject code and roll the dice.