You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bzt 7ace64ba9f Initial commit 7 years ago
..
Makefile Initial commit 7 years ago
OLVASSEL.md Initial commit 7 years ago
README.md Initial commit 7 years ago
gpio.h Initial commit 7 years ago
kernel8.img Initial commit 7 years ago
link.ld Initial commit 7 years ago
main.c Initial commit 7 years ago
mbox.c Initial commit 7 years ago
mbox.h Initial commit 7 years ago
rand.c Initial commit 7 years ago
rand.h Initial commit 7 years ago
start.S Initial commit 7 years ago
uart.c Initial commit 7 years ago
uart.h Initial commit 7 years ago

README.md

Tutorial 06 - Hardware Random Number Generator

This going to be an easy tutorial. We query a number from the (undocumented) hardware random number generator. You can use this to implement a simple, but accurate dice throw in any game. It is important as without hardware support you can only generate pseudo-random numbers.

Rand.h, rand.c

rand_init() initializes the hardware.

rand(min,max) returns a random number between min and max.

Main

We query a random value and then we display it on the serial console.