# 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_tones
  This is the Module to interact in a save way with the ArduboyTones C++ library.
- arduboyfx
  This is the Module to interact in a save way with the ArduboyFX C++ library.
- ardvoice
  This is the Module to interact in a save way with the ArdVoice C++ library.
- buttons
  A list of all six buttons available on the Arduboy
- fx
  Functions given by the ArduboyFX library.
- led
  A list of all LED variables available
- serial
  This is the Module to interact in a save way with the Arduino Serial C++ library.
- 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_ardvoice_tone_addr
  Create a `const` raw pointer to a ardvoice tone as u8, without creating an intermediate reference.
- 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 tone sequenze as u16, without creating an intermediate reference.
- progmem
  Create a space for Progmem variable

## Structs

- ArdVoice
  This is the struct to interact in a save way with the ArdVoice C++ library.
- 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.
- EEPROMBYTECHECKLESS
  Use this struct to store and read single bytes to/from eeprom memory without using a check digit.
- 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
- ANY_BUTTON
  Just a `const` for the any
- 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.