# Module arduboy_rust::prelude

source ·
Expand description

This is the important one to use this library effective in your project

Import the module:

    use arduboy_rust::prelude::*;

## Modules

- arduboy2
  This is the Module to interact in a save way with the Arduboy2 C++ library.
- arduboy_tone
  This is the Module to interact in a save way with the ArduboyTones C++ library.
- buttons
  A list of all six buttons available on the Arduboy
- led
  A list of all LED variables available
- sprites
  This is the module to interact in a save way with the Sprites C++ library.

## Macros

- f
  This is the way to go if you want print some random text
- get_sprite_addr
  Create a `const` raw pointer to a sprite as u8, without creating an intermediate reference.
- get_string_addr
  Create a `const` raw pointer to a [u8;_] that saves text, without creating an intermediate reference.
- get_tones_addr
  Create a `const` raw pointer to a sprite as u16, without creating an intermediate reference.
- progmem
  Create a space for Progmem variable

## Structs

- Arduboy2
  This is the struct to interact in a save way with the Arduboy2 C++ library.
- ArduboyTones
  This is the struct to interact in a save way with the ArduboyTones C++ library.
- ButtonSet
  This struct gives the library a understanding what Buttons on the Arduboy are.
- EEPROM
  This is the struct to store and read structs objects to/from eeprom memory.
- EEPROMBYTE
  Use this struct to store and read single bytes to/from eeprom memory.
- LinearMap
  A fixed capacity map / dictionary that performs lookups via linear search
- Point
  This struct is used by a few Arduboy functions.
- Rect
  This struct is used by a few Arduboy functions.
- String
  A fixed capacity `String`
- Vec
  A fixed capacity `Vec`

## Enums

- Base
- Color
  This item is to chose between Black or White

## Constants

- A
  Just a `const` for the A button
- A_BUTTON
  Just a `const` for the A button
- B
  Just a `const` for the B button
- BLUE_LED
  Just a `const` for the blue led
- B_BUTTON
  Just a `const` for the B button
- DOWN
  Just a `const` for the DOWN button
- DOWN_BUTTON
  Just a `const` for the DOWN button
- FONT_SIZE
  The standard font size of the arduboy
- GREEN_LED
  Just a `const` for the green led
- HEIGHT
  The standard height of the arduboy
- LEFT
  Just a `const` for the LEFT button
- LEFT_BUTTON
  Just a `const` for the LEFT button
- RED_LED
  Just a `const` for the red led
- RGB_OFF
  Just a `const` for led off
- RGB_ON
  Just a `const` for led on
- RIGHT
  Just a `const` for the RIGHT button
- RIGHT_BUTTON
  Just a `const` for the RIGHT button
- UP
  Just a `const` for the UP button
- UP_BUTTON
  Just a `const` for the UP button
- WIDTH
  The standard width of the arduboy

## Traits

- Printable

## Functions

- constrain
- delay
  A Arduino function to pause the cpu circles for a given amount of ms
- random_between
  A Arduino function to get a random number between 2 numbers seed based
- random_less_than
  A Arduino function to get a random number smaller than the number given seed based
- strlen
  A C function to get the length of a string

## Type Definitions

- c_size_t Experimental
  Equivalent to C’s `size_t` type, from `stddef.h` (or `cstddef` for C++).
- c_char
  Equivalent to C’s `char` type.
- c_double
  Equivalent to C’s `double` type.
- c_float
  Equivalent to C’s `float` type.
- c_int
  Equivalent to C’s `signed int` (`int`) type.
- c_long
  Equivalent to C’s `signed long` (`long`) type.
- c_longlong
  Equivalent to C’s `signed long long` (`long long`) type.
- c_uchar
  Equivalent to C’s `unsigned char` type.
- c_uint
  Equivalent to C’s `unsigned int` type.
- c_ulong
  Equivalent to C’s `unsigned long` type.
- c_ulonglong
  Equivalent to C’s `unsigned long long` type.