Skip to content
ScottD edited this page Feb 21, 2017 · 1 revision

The Buzzerclass constructs objects that represent the buzzer attached to the physical Jewelbot. This allows you to control the short and long vibration taps your Jewelbot can make.

COMPONENT INTIALIZATION

Buzzer buzz;
//naming the variable type and then the name of variable.

API

  • .extra_short_buzz()

    This function has your Jewelbot vibrate for an extra short amount of time (125 ms).

    Buzzer buzz;
    buzz.extra_short_buzz();
  • .short_buzz()

    This function has your Jewelbot vibrate for a short amount of time (250 ms).

    Buzzer buzz;
    buzz.short_buzz();
  • .medium_buzz()

    This function has your Jewelbot vibrate for a medium amount of time (500 ms).

    Buzzer buzz;
    buzz.medium_buzz();
  • .long_buzz()

    This function has your Jewelbot vibrate for a long amount of time (750 ms).

    Buzzer buzz;
    buzz.long_buzz();
  • .extra_long_buzz()

    This function has your Jewelbot vibrate for an extra long amount of time (1000 ms).

    Buzzer buzz;
    buzz.extra_long_buzz();
  • .really_long_buzz()

    This function has your Jewelbot vibrate for a really long amount of time (1500 ms).

    Buzzer buzz;
    buzz.really_long_buzz();
  • .custom_buzz(uint8_t amplitude, uint32_t milliseconds)

    This function creates a custom buzz!

    Amplitude is a measure of how strong the motor vibrates.
    Amplitude can be from 0 (no buzz) to 127 (max buzz).
    Jewelbots typically buzz right in the middle at an amplitude of 63

    Milliseconds is how long the motor will vibrate.
    Millisecond is measured in, you guessed it, milliseconds.
    40 ms is the minimum allowed and 2 s (2000 ms) is the max for longevity

    Buzzer buzz;
    buzz.custom_buzz(63, 500); //This will buzz at 50% strength for 1/2 second.
Clone this wiki locally