Little Robot Friends
Arduino Library Reference  version 1.1
LRFEventHandlers.h File Reference

Contains all the built-in handlers that control how the LRF responds to different events. More...

#include <Arduino.h>

Go to the source code of this file.

Typedefs

typedef void(* LRFEventHandler )(void)
 Function pointer with no parameters and no return value. More...
 

Enumerations

enum  LRFEvent
 Constants for different interaction and system events. More...
 

Typedef Documentation

LRFEventHandler

This function pointer type is compatible with how the LRF handling events. Used in conjunction with a setEventHandler function, this allows you to create a custom handler for events.

Usage:

void myEventHandler(void){
    lrf.doSomething(); // do something
}

lrf.setEventHandler(LRFEvent_Tickle, &myEventHandler);
See also
LittleRobotFriend::setEventHandler(LRFEvent event, LRFEventHandler handler)

Definition at line 89 of file LRFEventHandlers.h.

Enumeration Type Documentation

enum LRFEvent

The LRF current features 16 unique events broken down into interaction and system events. Interaction events include things like touch events, light sensor events, mic events and IR events. System events include things like sleep, wake, powerup and boredom.

Enumerator
LRFEvent_Tap 

Single touch.

LRFEvent_Tickle 

Multiple touch.

LRFEvent_Hug 

Long touch.

LRFEvent_LightsOff 

Any level to dark.

LRFEvent_LightsOn 

Dark to any level.

LRFEvent_LightsBright 

Any level to bright.

LRFEvent_LightsLongDark 

Prolonged darkness.

LRFEvent_HeardLoudNoise 

Mic gets triggered.

LRFEvent_MessageReceived 

Irda received a message.

LRFEvent_MessageFailed 

Irda received a garbled message

LRFEvent_IsHungry 

Battery is getting low.

LRFEvent_IsBored 

No interaction in a while.

LRFEvent_Sleep 

About to go to sleep.

LRFEvent_Wake 

Just woke up.

LRFEvent_PowerUp 

Just powered on (batteries in)

LRFEvent_MoodChanged 

Depricated (don't use)

LRFEvent_Unknown 

Unrecognized event.

Definition at line 48 of file LRFEventHandlers.h.