Little Robot Friends
Arduino Library Reference
version 1.1
LRFEventHandlers.h
Go to the documentation of this file.
1
//
2
// LRFEventHandlers.h
3
// LittleRobotFriends
4
//
5
// Created by Mark Argo on 2014-03-14.
6
// Copyright (c) 2014 Aesthetec Studio Inc. All rights reserved.
7
//
8
9
/*
10
THIS SOFTWARE IS PROVIDED “AS IS”, WITHOUT ANY REPRESENTATIONS, CONDITIONS,
11
AND/OR WARRANTIES OF ANY KIND. WITHOUT LIMITATION, AESTHETEC STUDIO AND ITS
12
AFFILIATES, LICENSORS, SUPPLIERS, CONTRIBUTORS, SUBCONTRACTORS, DISTRIBUTORS
13
AND ALL CONTRIBUTORS DISCLAIM ANY EXPRESS OR IMPLIED REPRESENTATIONS,
14
CONDITIONS, OR WARRANTIES OF MERCHANTABILITY, MERCHANTABLE QUALITY, SATISFACTORY
15
QUALITY, NON-INFRINGEMENT, TITLE, DURABILITY, OR FITNESS FOR A PARTICULAR
16
PURPOSE, WHETHER ARISING BY STATUTE, COURSE OF DEALING, USAGE OF TRADE, OR
17
OTHERWISE. EXCEPT AS OTHERWISE PROVIDED IN THIS AGREEMENT, YOU SHALL BEAR
18
THE ENTIRE RISK FOR ANY USE OR ANY OTHER EXPLOITATION MADE BY YOU OF ANY
19
RIGHTS IN THE COVERED SOFTWARE.
20
21
Additional copyright information found at http://littlerobotfriends.com/legal/
22
*/
23
31
#ifndef __LRFEventHandlers_h
32
#define __LRFEventHandlers_h
33
34
#include <Arduino.h>
35
36
#define LRF_EVENT_HANDLERS_DEBUG 0
37
38
#define LRF_EVENTS_INTERACTION_START_IDX 0
39
#define LRF_EVENTS_INTERACTION_END_IDX 9
40
#define LRF_EVENTS_SYSTEM_START_IDX 10
41
#define LRF_EVENTS_SYSTEM_END_IDX 15
42
46
48
typedef
enum
49
{
51
LRFEvent_Tap
= 0,
52
LRFEvent_Tickle
= 1,
53
LRFEvent_Hug
= 2,
54
LRFEvent_LightsOff
= 3,
55
LRFEvent_LightsOn
= 4,
56
LRFEvent_LightsBright
= 5,
57
LRFEvent_LightsLongDark
= 6,
58
LRFEvent_HeardLoudNoise
= 7,
59
LRFEvent_MessageReceived
= 8,
60
LRFEvent_MessageFailed
= 9,
61
64
LRFEvent_IsHungry
= 10,
65
LRFEvent_IsBored
= 11,
66
LRFEvent_Sleep
= 12,
67
LRFEvent_Wake
= 13,
68
LRFEvent_PowerUp
= 14,
69
LRFEvent_MoodChanged
= 15,
70
72
LRFEvent_Unknown
= 0xff
73
}
LRFEvent
;
74
79
89
typedef
void (*
LRFEventHandler
)(void);
90
91
extern
LRFEventHandler
lrfEventHandlers[];
92
93
#endif
LRFEvent_Hug
Long touch.
Definition:
LRFEventHandlers.h:53
LRFEvent_LightsLongDark
Prolonged darkness.
Definition:
LRFEventHandlers.h:57
LRFEvent_Sleep
About to go to sleep.
Definition:
LRFEventHandlers.h:66
LRFEvent_IsHungry
Battery is getting low.
Definition:
LRFEventHandlers.h:64
LRFEvent
LRFEvent
Constants for different interaction and system events.
Definition:
LRFEventHandlers.h:48
LRFEvent_HeardLoudNoise
Mic gets triggered.
Definition:
LRFEventHandlers.h:58
LRFEvent_LightsBright
Any level to bright.
Definition:
LRFEventHandlers.h:56
LRFEvent_Wake
Just woke up.
Definition:
LRFEventHandlers.h:67
LRFEvent_Unknown
Unrecognized event.
Definition:
LRFEventHandlers.h:72
LRFEvent_LightsOff
Any level to dark.
Definition:
LRFEventHandlers.h:54
LRFEventHandler
void(* LRFEventHandler)(void)
Function pointer with no parameters and no return value.
Definition:
LRFEventHandlers.h:89
LRFEvent_PowerUp
Just powered on (batteries in)
Definition:
LRFEventHandlers.h:68
LRFEvent_Tickle
Multiple touch.
Definition:
LRFEventHandlers.h:52
LRFEvent_MessageFailed
Definition:
LRFEventHandlers.h:60
LRFEvent_LightsOn
Dark to any level.
Definition:
LRFEventHandlers.h:55
LRFEvent_IsBored
No interaction in a while.
Definition:
LRFEventHandlers.h:65
LRFEvent_MessageReceived
Irda received a message.
Definition:
LRFEventHandlers.h:59
LRFEvent_Tap
Single touch.
Definition:
LRFEventHandlers.h:51
LRFEvent_MoodChanged
Definition:
LRFEventHandlers.h:69
LRFEventHandlers.h
a project by