TinyTrainable base class. More...
#include <TinyTrainable.h>
Public Member Functions | |
| TinyTrainable (InputType inputType, OutputType outputType) | |
| TinyTrainable constructor. | |
| ~TinyTrainable () | |
| TinyTrainable destructor. | |
| template<typename T > | |
| void | debugPrint (T message) |
| void | setupInstrument (bool serialDebugging) |
| setup debugging | |
| void | setupLEDs () |
| initialize LEDs of Arduino | |
| void | setStateLEDBuiltIn (bool turnOn) |
| set state of LED built-in | |
| void | setStateLEDRGB (bool turnOn, Colors color) |
| set state of LED RGB | |
| void | blinkLEDBuiltIn (int blinks) |
| blink LED built-in | |
| void | blinkLEDRGB (int blinks, Colors color) |
| blink LED RGB | |
| void | identify () |
| input, identify class | |
| void | trainKNN (int k, int examplesPerClass, String objects[3]) |
| input color, train KNN algorithm | |
| void | setupGestureModel (String gestures[3], const unsigned char *model=nullptr) |
| input gesture, setup TensorFlow model | |
| void | gesturePrintHeader () |
| input gesture, print header for database | |
| void | gestureReadData () |
| input gesture, read data for database | |
| void | gestureSetAcceleration (float newVal) |
| input gesture, sets custom acceleration threshold | |
| void | gestureSetNumberSamples (int newVal) |
| input gesture, sets custom number of samples | |
| void | setupSpeechModel (String sounds[3], const unsigned char *model=nullptr) |
| input speech, setup TensorFlow model | |
| void | setupOutputTest () |
| output, test if it is working | |
| void | playOutput (int classification) |
| output, react to classification | |
| void | setupOutputBuzzer (int outputPin) |
| void | getBuzzerParam (int object, int buzzerParamArray[]) |
| void | setBuzzerFrequency (int object, int frequency) |
| void | setBuzzerFrequency (int object, int freqMin, int freqMax) |
| void | setBuzzerFrequency (int object, int *arrayFrequencies, int arrayFreqCount) |
| void | setBuzzerDuration (int object, int duration) |
| void | setBuzzerDuration (int object, int durationMin, int durationMax) |
| void | setBuzzerDuration (int object, int *arrayDurations, int arrayDurationCount) |
| void | setupOutputLED (int object, int outputPin) |
| void | setupOutputMIDI (byte midiChannel) |
| void | setMIDINote (int object, int note) |
| void | sendMIDINoteOn (byte channel, byte note, byte velocity) |
| void | sendMIDINoteOff (byte channel, byte note) |
| void | sendMIDIAllNotesOff (byte channel) |
| void | setupOutputPrinter () |
| void | setPrinterBaudRate (int rate) |
| void | setPrinterBegin () |
| void | setPrinterPause (int pause) |
| void | setPrinterSleep () |
| void | setPrinterWake () |
| void | setPrinterTest () |
| void | setupOutputScreen () |
| void | screenDrawWelcome () |
| void | setupOutputSerial () |
| void | setupOutputServo (int outputPin) |
| void | setServoTempo (int object, int tempo) |
| int | bpmToMs (int tempo) |
| void | setServoMaxAngle (int angle) |
| void | setServoMinAngle (int angle) |
| int | getServoMaxAngle () |
| int | getServoMinAngle () |
| void | moveServo (int classification) |
Static Public Attributes | |
| static bool | _serialDebugging = false |
| pin for output | |
| static int | _baudRate = 9600 |
| static integer, baud rate for serial communication | |
| static int | _timeBlinkLED = 500 |
| static integer, time for blinking LED | |
Protected Attributes | |
| Input * | myInput = nullptr |
| Input pointer. | |
| Output * | myOutput = nullptr |
| Output pointer. | |
TinyTrainable base class.
| TinyTrainable::TinyTrainable | ( | InputType | inputType, |
| OutputType | outputType | ||
| ) |
| TinyTrainable::~TinyTrainable | ( | ) |
TinyTrainable destructor.
destructor
| void TinyTrainable::blinkLEDBuiltIn | ( | int | blinks | ) |
blink LED built-in
| blinks | integer, number of blinks |
| void TinyTrainable::blinkLEDRGB | ( | int | blinks, |
| Colors | color | ||
| ) |
blink LED RGB
| blinks | integer, number of blinks |
| int TinyTrainable::bpmToMs | ( | int | tempo | ) |
|
inline |
| void TinyTrainable::gesturePrintHeader | ( | ) |
input gesture, print header for database
| void TinyTrainable::gestureReadData | ( | ) |
input gesture, read data for database
| void TinyTrainable::gestureSetAcceleration | ( | float | newVal | ) |
input gesture, sets custom acceleration threshold
| void TinyTrainable::gestureSetNumberSamples | ( | int | newVal | ) |
input gesture, sets custom number of samples
| void TinyTrainable::getBuzzerParam | ( | int | object, |
| int | buzzerParamArray[] | ||
| ) |
| int TinyTrainable::getServoMaxAngle | ( | ) |
| int TinyTrainable::getServoMinAngle | ( | ) |
| void TinyTrainable::identify | ( | ) |
input, identify class
| void TinyTrainable::moveServo | ( | int | classification | ) |
| void TinyTrainable::playOutput | ( | int | classification | ) |
output, react to classification
| void TinyTrainable::screenDrawWelcome | ( | ) |
| void TinyTrainable::sendMIDIAllNotesOff | ( | byte | channel | ) |
| void TinyTrainable::sendMIDINoteOff | ( | byte | channel, |
| byte | note | ||
| ) |
| void TinyTrainable::sendMIDINoteOn | ( | byte | channel, |
| byte | note, | ||
| byte | velocity | ||
| ) |
| void TinyTrainable::setBuzzerDuration | ( | int | object, |
| int * | arrayDurations, | ||
| int | arrayDurationCount | ||
| ) |
| void TinyTrainable::setBuzzerDuration | ( | int | object, |
| int | duration | ||
| ) |
| void TinyTrainable::setBuzzerDuration | ( | int | object, |
| int | durationMin, | ||
| int | durationMax | ||
| ) |
| void TinyTrainable::setBuzzerFrequency | ( | int | object, |
| int * | arrayFrequencies, | ||
| int | arrayFreqCount | ||
| ) |
| void TinyTrainable::setBuzzerFrequency | ( | int | object, |
| int | freqMin, | ||
| int | freqMax | ||
| ) |
| void TinyTrainable::setBuzzerFrequency | ( | int | object, |
| int | frequency | ||
| ) |
| void TinyTrainable::setMIDINote | ( | int | object, |
| int | note | ||
| ) |
| void TinyTrainable::setPrinterBaudRate | ( | int | rate | ) |
| void TinyTrainable::setPrinterBegin | ( | ) |
| void TinyTrainable::setPrinterPause | ( | int | pause | ) |
| void TinyTrainable::setPrinterSleep | ( | ) |
| void TinyTrainable::setPrinterTest | ( | ) |
| void TinyTrainable::setPrinterWake | ( | ) |
| void TinyTrainable::setServoMaxAngle | ( | int | angle | ) |
| void TinyTrainable::setServoMinAngle | ( | int | angle | ) |
| void TinyTrainable::setServoTempo | ( | int | object, |
| int | tempo | ||
| ) |
| void TinyTrainable::setStateLEDBuiltIn | ( | bool | turnOn | ) |
set state of LED built-in
| turnOn | boolean, on/off |
| void TinyTrainable::setStateLEDRGB | ( | bool | turnOn, |
| Colors | color | ||
| ) |
set state of LED RGB
| turnOn | boolean, on/off |
| color | Color |
| void TinyTrainable::setupGestureModel | ( | String | gestures[3], |
| const unsigned char * | model = nullptr |
||
| ) |
input gesture, setup TensorFlow model
input gesture, setup TensorFlow
| void TinyTrainable::setupInstrument | ( | bool | serialDebugging | ) |
setup debugging
method for initial setup
| serialDebugging | to toggle serial debugging on/off |
| serialDebugging | to output or not debug info over serial |
| void TinyTrainable::setupLEDs | ( | ) |
initialize LEDs of Arduino
| void TinyTrainable::setupOutputBuzzer | ( | int | outputPin | ) |
| void TinyTrainable::setupOutputLED | ( | int | object, |
| int | outputPin | ||
| ) |
| void TinyTrainable::setupOutputMIDI | ( | byte | midiChannel | ) |
| void TinyTrainable::setupOutputPrinter | ( | ) |
| void TinyTrainable::setupOutputScreen | ( | ) |
| void TinyTrainable::setupOutputSerial | ( | ) |
| void TinyTrainable::setupOutputServo | ( | int | outputPin | ) |
| void TinyTrainable::setupOutputTest | ( | ) |
output, test if it is working
| void TinyTrainable::setupSpeechModel | ( | String | sounds[3], |
| const unsigned char * | model = nullptr |
||
| ) |
input speech, setup TensorFlow model
| void TinyTrainable::trainKNN | ( | int | k, |
| int | examplesPerClass, | ||
| String | objects[3] | ||
| ) |
input color, train KNN algorithm
| k | int, for KNN |
| examplesPerClass | int, examples per class |
| objects[] | String array, names of classes |
|
static |
static integer, baud rate for serial communication
static variable, integer, baud rate
|
static |
pin for output
static variable, boolean, serial debugging
static boolean, toggles debugging over serial port
for each input
for each output
|
static |
static integer, time for blinking LED