LED roulette

    I’m going to give you a high level API to implement this app but don’t worry we’ll do low levelstuff later on. The main goal of this chapter is to get familiar with the flashing and debuggingprocess.

    The starter code is in the directory of that repository. Inside that directory there are moredirectories named after each chapter of this book. Most of those directories are starter Cargoprojects.

    Now, jump into the src/05-led-roulette directory. Check the src/main.rs file:

    The no_std attribute says that this program won’t use the crate, which assumes an underlyingOS; the program will instead use the core crate, a subset of std that can run on bare metalsystems (i.e., systems without OS abstractions like files and sockets).

    The no_main attribute says that this program won’t use the standard main interface, which istailored for command line applications that receive arguments. Instead of the standard main we’lluse the attribute from the crate to define a custom entry point. In thisprogram we have named the entry point “main”, but any other name could have been used. The entrypoint function must have signature fn() -> !; this type indicates that the function can’t return— this means that the program never terminates.

    Alright, let’s start by building this program.