Little Robot Friends
Arduino Library Reference  version 1.1
MyLRF01_Blink.cpp
1 //
2 // MyLRF01-Blink.cpp
3 // LittleRobotFriends
4 //
5 // Created by Mark Argo on 2014-06-11.
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 
24 //
25 
40 #include "LRF.h"
41 
42 // Create a light pattern for the eyes
43 LRFPattern myPattern = {
44  LRFColor_Blue, // starting color
45  LRFColor_Green, // target color
46  LRFPatternMode_Fade // pattern behaviour (see LRFUtils.h for more info)
47 };
48 
49 // ------------------ everything below this point runs the program --------------------
50 
51 
52 void setup(void) // Arduino setup routine that gets called ONCE when the robot turns on
53 {
54  lrf.setup(); // lrf library should be set up before anything else
55  delay(1000);
56 
57  lrf.blink(myPattern); // let's try blinking our pattern
58  delay(1000);
59 }
60 
61 
62 void loop(void) // Arduino loop routine that gets called OVER AND OVER while the robot runs
63 {
64  lrf.loop(); // run the lrf library
65 }
void loop(void)
run the LRF library loop
Definition: LRF.cpp:175
void blink(LRFPattern pattern)
Blink a light pattern on the LED eyes.
Definition: LRF.cpp:198
This is the core API class for access LRF library functions.
Green.
Definition: LRFUtils.h:50
Fade from start to target.
Definition: LRFUtils.h:95
void setup(void)
setup the LRF library
Definition: LRF.cpp:108
Allows for access of pattern data as a structure or raw integer.
Definition: LRFUtils.h:156
Blue.
Definition: LRFUtils.h:51