Anda di halaman 1dari 72

Arduboy Library

1.1.0

Generated by Doxygen 1.8.9.1

Wed Jun 15 2016 08:04:13


Contents

1 Main Page 1

2 Individual Contributors 3

3 ArduBreakout 5

4 Benchmark run as of June 2015 7

5 Tunes 9

6 Hierarchical Index 11
6.1 Class Hierarchy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

7 Data Structure Index 13


7.1 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

8 File Index 15
8.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

9 Data Structure Documentation 17


9.1 Arduboy Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
9.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
9.1.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
9.1.2.1 Arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
9.1.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
9.1.3.1 begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
9.1.3.2 beginNoLogo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.1.3.3 bootLogo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.1.3.4 bootUtils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.1.3.5 clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.1.3.6 clearDisplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.1.3.7 cpuLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
9.1.3.8 display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.1.3.9 drawBitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
iv CONTENTS

9.1.3.10 drawChar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.1.3.11 drawCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.1.3.12 drawCircleHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
9.1.3.13 drawFastHLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.1.3.14 drawFastVLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.1.3.15 drawLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.1.3.16 drawPixel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.1.3.17 drawRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.1.3.18 drawRoundRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
9.1.3.19 drawSlowXYBitmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.20 drawTriangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.21 everyXFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.22 fillCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.23 fillCircleHelper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.24 fillRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.25 fillRoundRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
9.1.3.26 fillScreen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.1.3.27 fillTriangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.1.3.28 getBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.1.3.29 getPixel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.1.3.30 initRandomSeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.1.3.31 nextFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
9.1.3.32 notPressed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1.3.33 pressed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1.3.34 rawADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1.3.35 setCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1.3.36 setFrameRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1.3.37 setTextSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9.1.3.38 setTextWrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.3.39 start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.3.40 swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.3.41 write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.4 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.4.1 audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.4.2 cursor_x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.4.3 cursor_y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1.4.4 eachFrameMillis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.5 frameCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.6 frameRate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.7 lastFrameDurationMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


CONTENTS v

9.1.4.8 lastFrameStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.9 nextFrameStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.10 post_render . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.11 sBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.12 textsize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
9.1.4.13 tunes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.1.4.14 wrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.2 ArduboyAudio Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.2.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.2.2.1 begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
9.2.2.2 enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.2.2.3 off . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.2.2.4 on . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.2.2.5 saveOnOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.2.3 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.2.3.1 audio_enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.3 ArduboyCore Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
9.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.2 Constructor & Destructor Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.2.1 ArduboyCore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.3 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.3.1 allPixelsOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.3.2 blank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.3.3 boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9.3.3.4 bootLCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3.3.5 bootPins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3.3.6 buttonsState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3.3.7 flipHorizontal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3.3.8 flipVertical . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3.3.9 getInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3.3.10 height . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.3.3.11 idle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.3.3.12 invert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.3.3.13 LCDCommandMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.3.3.14 LCDDataMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9.3.3.15 paint8Pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9.3.3.16 paintScreen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9.3.3.17 paintScreen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9.3.3.18 safeMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


vi CONTENTS

9.3.3.19 saveMuchPower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
9.3.3.20 sendLCDCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.3.21 setRGBled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.3.22 slowCPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.3.23 width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.4 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.4.1 cspinmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.4.2 csport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.4.3 dcpinmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9.3.4.4 dcport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
9.3.4.5 mosipinmask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
9.3.4.6 mosiport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
9.4 ArduboyTunes Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
9.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2 Member Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.1 closeChannels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.2 delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.3 initChannel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.4 playing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.5 playNote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.6 playScore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.4.2.7 soundOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
9.4.2.8 step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
9.4.2.9 stopNote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
9.4.2.10 stopScore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
9.4.2.11 tone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
9.5 Print Class Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

10 File Documentation 41
10.1 Arduboy/CONTRIBUTORS.md File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
10.2 Arduboy/examples/ArduBreakout/ArduBreakout.ino File Reference . . . . . . . . . . . . . . . . . 41
10.3 Arduboy/examples/ArduBreakout/breakout_bitmaps.cpp File Reference . . . . . . . . . . . . . . . 41
10.3.1 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
10.3.1.1 arrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
10.3.1.2 fire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10.3.1.3 title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10.4 Arduboy/examples/ArduBreakout/breakout_bitmaps.h File Reference . . . . . . . . . . . . . . . . 42
10.4.1 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10.4.1.1 arrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10.4.1.2 fire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


CONTENTS vii

10.4.1.3 title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
10.5 Arduboy/examples/ArduBreakout/README.md File Reference . . . . . . . . . . . . . . . . . . . 42
10.6 Arduboy/examples/Performance/README.md File Reference . . . . . . . . . . . . . . . . . . . . 42
10.7 Arduboy/examples/Tunes/README.md File Reference . . . . . . . . . . . . . . . . . . . . . . . 43
10.8 Arduboy/README.md File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
10.9 Arduboy/examples/Buttons/Buttons.ino File Reference . . . . . . . . . . . . . . . . . . . . . . . . 43
10.9.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
10.9.1.1 CHAR_HEIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
10.9.1.2 CHAR_WIDTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
10.9.1.3 NUM_CHARS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
10.9.1.4 X_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.1.5 Y_MAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.2.1 loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.2.2 setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.3.1 arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.3.2 text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.3.3 x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.9.3.4 y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
10.10Arduboy/examples/HelloWorld/HelloWorld.ino File Reference . . . . . . . . . . . . . . . . . . . . 45
10.10.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.10.1.1 loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.10.1.2 setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.10.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.10.2.1 arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.11Arduboy/examples/Tunes/Tunes.ino File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.11.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.1.1 loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.1.2 setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.2.1 arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.2.2 score . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.2.3 x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.11.2.4 y . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.12Arduboy/src/ab_logo.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
10.12.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.12.1.1 ARDUBOY_LOGO_CREATED . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.12.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.12.2.1 arduboy_logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


viii CONTENTS

10.13Arduboy/src/Arduboy.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47


10.14Arduboy/src/Arduboy.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
10.14.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.1 ADC_TEMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.2 ADC_VOLTAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.3 EEPROM_AUDIO_ON_OFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.4 EEPROM_BRIGHTNESS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.5 EEPROM_STORAGE_SPACE_START . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.6 EEPROM_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.14.1.7 PIXEL_SAFE_MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.15Arduboy/src/audio/audio.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.15.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.15.1.1 ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.15.1.2 ISR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.15.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.15.2.1 _midi_byte_note_frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
10.15.2.2 _midi_word_note_frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.15.2.3 _tune_num_chans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.15.2.4 _tune_pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.15.2.5 _tunes_timer1_pin_mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.15.2.6 _tunes_timer1_pin_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.15.2.7 _tunes_timer3_pin_mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
10.15.2.8 _tunes_timer3_pin_port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.9 score_cursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.10score_start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.11timer1_toggle_count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.12tonePlaying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.13tune_pin_to_timer_PGM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.14tune_playing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.15wait_timer_frequency2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.16wait_timer_playing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
10.15.2.17wait_toggle_count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16Arduboy/src/audio/audio.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16.1.1 AVAILABLE_TIMERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16.1.2 TUNE_OP_PLAYNOTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16.1.3 TUNE_OP_RESTART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16.1.4 TUNE_OP_STOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
10.16.1.5 TUNE_OP_STOPNOTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.17Arduboy/src/core/core.cpp File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


CONTENTS ix

10.17.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


10.17.1.1 OLED_HORIZ_FLIPPED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.17.1.2 OLED_HORIZ_NORMAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.17.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.17.2.1 lcdBootProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.17.2.2 pinBootProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
10.18Arduboy/src/core/core.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
10.18.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.1 A_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.2 ARDUBOY_10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.3 B_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.4 BLACK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.5 BLUE_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.6 COLUMN_ADDRESS_END . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
10.18.1.7 CS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.8 DC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.9 DOWN_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.10GREEN_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.11HEIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.12INVERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.13LEFT_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.14OLED_ALL_PIXELS_ON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.15OLED_PIXELS_FROM_RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10.18.1.16OLED_PIXELS_INVERTED . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.17OLED_PIXELS_NORMAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.18OLED_VERTICAL_FLIPPED . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.19OLED_VERTICAL_NORMAL . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.20PAGE_ADDRESS_END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.21PIN_A_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.22PIN_B_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.23PIN_DOWN_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.24PIN_LEFT_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.25PIN_RIGHT_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.26PIN_SPEAKER_1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.18.1.27PIN_SPEAKER_1_BITMASK . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.28PIN_SPEAKER_1_PORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.29PIN_SPEAKER_2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.30PIN_SPEAKER_2_BITMASK . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.31PIN_SPEAKER_2_PORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.32PIN_UP_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


x CONTENTS

10.18.1.33RED_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.34RIGHT_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.35RST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.36RX_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.37TX_LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
10.18.1.38UP_BUTTON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.18.1.39WHITE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.18.1.40WIDTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.19Arduboy/src/glcdfont.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.19.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.19.1.1 FONT5X7_H . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.19.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
10.19.2.1 PROGMEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 1

Main Page

This documentation provides provides instructions for installing and using the Arduboy Library.

About the Library

The Arduboy Library provides a programming interface for the creation of games and applications that run on the
Arduboy handheld device. The Arduboy is supported by the Arduino platform and is powered by an Atmel A←-
Tmega32u4 MCU.
More information can be found at https://arduboy.com.

Using the Library

To use the Arduboy library, it must be installed and then included in your project.

Installing Arduboy Library 1.1

There are several ways to install the Arduboy Library v1.1 for use in your projects. The recommended method, and
easiest to use when getting started, or when making simple apps, is through the Arduino IDE.

Adruino IDE - Recommended

After installing the Arduino IDE, the Arduboy Library can be added using IDE's built in Library Manager.
The Library Manager can be found in the Arduino IDE's menu bar in the Sketch drop down menu, Sketch >
Include Library > Manage Libraries....
After opening the Library Manager, search for "Arduboy" in the search field, or find the library in the other category.

Download an Archive

Archived versions of the 1.1.0 release of the Arduboy Library can be downloaded and uncompressed. See the
sub-section Where to Install, found at the bottom of this section.

Downloads (zip) (tar.gz)

Use Source Management (Git)

Install the library by cloning its repository. This will put you on the master branch, which is the newest version of
the library.

1 git clone https://github.com/Arduboy/Arduboy.git

To switch to version 1.1 of the library, checkout the v1.1 tag.


2 Main Page

1 git checkout tags/v1.1

Where to Install

The library should be installed into your user's home Arduino libraries directory. Refer to the following list for
the location of the Arduino libraries folder.
##### Linux

1 /home/username/Documents/Arduino/libraries

##### Mac

1 /Users/username/Documents/Arduino/libraries

##### Windows

1 C:\Users\username\My Documents\Arduino\libraries

If you don't find the libraries folder in one of the above locations, you can determine its location using the
navigation menu File > Preferences. In the Settings tab will be a Sketchbook location: field.
The libraries folder will be in the folder set in this field.

Including the Arduboy Library

To use the Arduboy library in your own sketches, include the Arduboy.h header file. To do so, add the following
line to the top of your .ino file.

#include <Arduboy.h>

You can have the Arduino IDE add #include "Arduboy.h" to your sketch automatically by using the naviga-
tion menu Sketch > Include Library > Arduboy.

Board Selection

Select the Leonardo board as the target platform.

Examples

Example games and source can be found in the examples directory.

Playing Examples

Find and play an example by opening it through the Arduino IDE, compiling, and uploading the example to the
Arduboy. Examples can be found in the Arduino IDE in the navigation menu under, File > Examples >
Arduboy > Example_Name.

Running on a Development Board

To run this library on a development Arduboy board, edit src/core/core.h so that #define AB_DEVKIT
is uncommented and #define ARDUBOY_10 is commented out.

//#define ARDUBOY_10 // compile for the production Arduboy v1.0


#define AB_DEVKIT // compile for the official dev kit

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


3

Sketches Already Including the Arduboy Library

Sketches that include copies of the Arduboy library may not compile if the Arduboy library has been installed system
wide. In these cases the Arduino compiler will try and link the system Arduboy library source with the local header
file, which can cause compilation errors if the local library source differs from the system's Arduboy source.
To compile sketches that have included copies of the Aruboy Library,
• Remove the local Arduboy.cpp and Arduboy.h files and try recompiling. This will only work in some cases.
OR,
• Rename Arduboy.h to CustomArduboy.h (or a similar name) and add, #include "Custom←-
Arduboy.h" to the sketch's .ino file.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


4 Main Page

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 2

Individual Contributors

Contributors

• Kevin "Arduboy" Bates - Bateske

• arduboychris - arduboychris

• Scott Allen - MLXXXp

• Ross - rogosher

• Andrew - ace-dent

• Josh Goebel - yyyc514

• NoelAbercrombie

Contributions From Other Projects

• Original SSD1306 library https://github.com/adafruit/Adafruit_SSD1306 BSD License


Copyright (c) 2012, Adafruit Industries

• arduino-playtune https://github.com/LenShustek/arduino-playtune GNU General Public


License v3 (C) Copyright 2011, 2015, Len Shustek
6 Individual Contributors

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 3

ArduBreakout

Brick breaking game in the vein of Atari's Breakout.


Control the paddle with the directional keys to keep a ball bouncing against a brick wall until all of the bricks are
broken.
High scores are saved to EEPROM and can be saved through Arduboy restarts.
8 ArduBreakout

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 4

Hello World Example

An example using the Arduboy Library that simple prints "Hello, World!" to the screen.
10 Hello World Example

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 5

Tunes Example

Play a musical composition using the Arduboy.


A small composition is stored by byte PROGMEM score. The score is played in the sketch loop using play←-
Score(score).
12 Tunes Example

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 6

Hierarchical Index

6.1 Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:


ArduboyAudio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
ArduboyCore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ArduboyTunes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
bool
boolean
int16_t
long
static bool
uint16_t
uint8_t
unsigned char
14 Hierarchical Index

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 7

Data Structure Index

7.1 Data Structures

Here are the data structures with brief descriptions:


Arduboy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
ArduboyAudio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
ArduboyCore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
ArduboyTunes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
16 Data Structure Index

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 8

File Index

8.1 File List

Here is a list of all files with brief descriptions:


Arduboy/examples/ArduBreakout/ArduBreakout.ino . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Arduboy/examples/ArduBreakout/breakout_bitmaps.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Arduboy/examples/ArduBreakout/breakout_bitmaps.h . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Arduboy/examples/Buttons/Buttons.ino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Arduboy/examples/HelloWorld/HelloWorld.ino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Arduboy/examples/Tunes/Tunes.ino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Arduboy/src/ab_logo.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Arduboy/src/Arduboy.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Arduboy/src/Arduboy.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Arduboy/src/glcdfont.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Arduboy/src/audio/audio.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Arduboy/src/audio/audio.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Arduboy/src/core/core.cpp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Arduboy/src/core/core.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
18 File Index

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 9

Data Structure Documentation

9.1 Arduboy Class Reference

#include <Arduboy.h>
Inheritance diagram for Arduboy:
Collaboration diagram for Arduboy:

Public Member Functions

• Arduboy ()
• boolean pressed (uint8_t buttons)
Returns true if the button mask passed in is pressed.
• boolean notPressed (uint8_t buttons)
Returns true if the button mask passed in not pressed.
• void begin ()
Initializes the hardware.
• void beginNoLogo ()
Initializes the hardware (but with no boot logo)
• void start ()
• void bootLogo ()
Scrolls in the Arduboy logo.
• void bootUtils ()
Boot utils such as flashlight, etc.
• void clear ()
Clears display.
• void clearDisplay ()
• void display ()
Copies the contents of the screen buffer to the screen.
• void drawPixel (int x, int y, uint8_t color)
Sets a single pixel on the screen buffer to white or black.
• uint8_t getPixel (uint8_t x, uint8_t y)
• void drawCircle (int16_t x0, int16_t y0, uint8_t r, uint8_t color)
Draw a circle of a defined radius.
• void drawCircleHelper (int16_t x0, int16_t y0, uint8_t r, uint8_t cornername, uint8_t color)
Draws one or more "corners" of a circle.
• void fillCircle (int16_t x0, int16_t y0, uint8_t r, uint8_t color)
Draws a filled-in circle.
20 Data Structure Documentation

• void fillCircleHelper (int16_t x0, int16_t y0, uint8_t r, uint8_t cornername, int16_t delta, uint8_t color)
Draws one or both vertical halves of a filled-in circle.
• void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color)
Draws a line between two points.
• void drawRect (int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
Draws a rectangle of a width and height.
• void drawFastVLine (int16_t x, int16_t y, uint8_t h, uint8_t color)
Draws vertical line.
• void drawFastHLine (int16_t x, int16_t y, uint8_t w, uint8_t color)
Draws a horizontal line.
• void fillRect (int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
Draws a filled-in rectangle.
• void fillScreen (uint8_t color)
Fills the screen buffer with white or black.
• void drawRoundRect (int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color)
Draws a rectangle with rounded edges.
• void fillRoundRect (int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color)
Draws a filled-in rectangle with rounded edges.
• void drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color)
Draws the outline of a triangle.
• void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color)
Draws a filled-in triangle.
• void drawBitmap (int16_t x, int16_t y, const uint8_t ∗bitmap, uint8_t w, uint8_t h, uint8_t color)
Draws a bitmap from program memory to a specific X/Y.
• void drawSlowXYBitmap (int16_t x, int16_t y, const uint8_t ∗bitmap, uint8_t w, uint8_t h, uint8_t color)
Draws images that are bit-oriented horizontally.
• void drawChar (int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size)
Draws an ASCII character at a point.
• void setCursor (int16_t x, int16_t y)
Sets the location of the screen cursor.
• void setTextSize (uint8_t s)
Set text size.
• void setTextWrap (boolean w)
Sets whether text will wrap at screen edges.
• unsigned char ∗ getBuffer ()
• virtual size_t write (uint8_t)
Writes a single ASCII character to the screen.
• void initRandomSeed ()
Seeds the random number generator with entropy from the temperature, voltage reading, and microseconds since
boot.
• void swap (int16_t &a, int16_t &b)
Swap the references of two pointers.
• void setFrameRate (uint8_t rate)
• bool nextFrame ()
• bool everyXFrames (uint8_t frames)
• int cpuLoad ()
Returns the load on the CPU as a percentage.
• uint16_t rawADC (byte adc_bits)
useful for getting raw approximate voltage values

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.1 Arduboy Class Reference 21

Data Fields

• ArduboyTunes tunes
• ArduboyAudio audio
• uint8_t frameRate
• uint16_t frameCount
• uint8_t eachFrameMillis
• long lastFrameStart
• long nextFrameStart
• bool post_render
• uint8_t lastFrameDurationMs

Protected Attributes

• unsigned char sBuffer [(HEIGHT ∗WIDTH)/8]


• int16_t cursor_x
• int16_t cursor_y
• uint8_t textsize
• boolean wrap

Additional Inherited Members

9.1.1 Detailed Description

Definition at line 27 of file Arduboy.h.

9.1.2 Constructor & Destructor Documentation

9.1.2.1 Arduboy::Arduboy ( )

Definition at line 5 of file Arduboy.cpp.


References cursor_x, cursor_y, frameCount, nextFrameStart, post_render, setFrameRate(), and textsize.
Here is the call graph for this function:

9.1.3 Member Function Documentation

9.1.3.1 void Arduboy::begin ( )

Initializes the hardware.


Definition at line 27 of file Arduboy.cpp.
References audio, ArduboyAudio::begin(), ArduboyCore::boot(), bootLogo(), bootUtils(), ArduboyTunes::init←-
Channel(), PIN_SPEAKER_1, PIN_SPEAKER_2, and tunes.
Referenced by setup(), and start().
Here is the call graph for this function:
Here is the caller graph for this function:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


22 Data Structure Documentation

9.1.3.2 void Arduboy::beginNoLogo ( )

Initializes the hardware (but with no boot logo)


Definition at line 43 of file Arduboy.cpp.
References audio, ArduboyAudio::begin(), ArduboyCore::boot(), bootUtils(), ArduboyTunes::initChannel(), PIN_S←-
PEAKER_1, PIN_SPEAKER_2, and tunes.
Here is the call graph for this function:

9.1.3.3 void Arduboy::bootLogo ( )

Scrolls in the Arduboy logo.


Definition at line 65 of file Arduboy.cpp.
References arduboy_logo, clear(), display(), drawBitmap(), ArduboyCore::setRGBled(), WHITE, and y.
Referenced by begin().
Here is the call graph for this function:
Here is the caller graph for this function:

9.1.3.4 void Arduboy::bootUtils ( ) [inline]

Boot utils such as flashlight, etc.


Definition at line 54 of file Arduboy.cpp.
References ArduboyCore::blank(), pressed(), ArduboyCore::setRGBled(), and UP_BUTTON.
Referenced by begin(), and beginNoLogo().
Here is the call graph for this function:
Here is the caller graph for this function:

9.1.3.5 void Arduboy::clear ( )

Clears display.
Definition at line 167 of file Arduboy.cpp.
References BLACK, and fillScreen().
Referenced by bootLogo(), clearDisplay(), displayHighScores(), enterInitials(), intro(), loop(), and titleScreen().
Here is the call graph for this function:
Here is the caller graph for this function:

9.1.3.6 void Arduboy::clearDisplay ( )

Definition at line 162 of file Arduboy.cpp.


References clear().
Here is the call graph for this function:

9.1.3.7 int Arduboy::cpuLoad ( )

Returns the load on the CPU as a percentage.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.1 Arduboy Class Reference 23

This is based on how much of the time your app is spends rendering frames. This number can be higher than 100
if your app is rendering really slowly.
Definition at line 133 of file Arduboy.cpp.
References eachFrameMillis, and lastFrameDurationMs.

9.1.3.8 void Arduboy::display ( )

Copies the contents of the screen buffer to the screen.


X and Y positions on the display are from the top left corner, thus a Y of 64 is the bottom of the screen and an X of
128 is the right side of the screen. "Color" or "value" means choosing whether a pixel is lit or not - if color is 0, the
pixel is off (black), if color is 1, the pixel is on (white).
Definition at line 731 of file Arduboy.cpp.
References ArduboyCore::paintScreen(), and sBuffer.
Referenced by bootLogo(), displayHighScores(), drawGameOver(), enterInitials(), intro(), loop(), pause(), setup(),
and titleScreen().
Here is the call graph for this function:
Here is the caller graph for this function:

9.1.3.9 void Arduboy::drawBitmap ( int16_t x, int16_t y, const uint8_t ∗ bitmap, uint8_t w, uint8_t h, uint8_t color )

Draws a bitmap from program memory to a specific X/Y.


Definition at line 591 of file Arduboy.cpp.
References BLACK, HEIGHT, WHITE, and WIDTH.
Referenced by bootLogo().
Here is the caller graph for this function:

9.1.3.10 void Arduboy::drawChar ( int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size )

Draws an ASCII character at a point.


Definition at line 649 of file Arduboy.cpp.
References HEIGHT, and WIDTH.
Referenced by write().
Here is the caller graph for this function:

9.1.3.11 void Arduboy::drawCircle ( int16_t x0, int16_t y0, uint8_t r, uint8_t color )

Draw a circle of a defined radius.


Draws a circle in white or black. X and Y are the center point of the circle.
Definition at line 199 of file Arduboy.cpp.
References drawPixel(), x, and y.
Here is the call graph for this function:

9.1.3.12 void Arduboy::drawCircleHelper ( int16_t x0, int16_t y0, uint8_t r, uint8_t cornername, uint8_t color )

Draws one or more "corners" of a circle.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


24 Data Structure Documentation

Definition at line 237 of file Arduboy.cpp.


References x, and y.

9.1.3.13 void Arduboy::drawFastHLine ( int16_t x, int16_t y, uint8_t w, uint8_t color )

Draws a horizontal line.


Definition at line 396 of file Arduboy.cpp.
References WIDTH.

9.1.3.14 void Arduboy::drawFastVLine ( int16_t x, int16_t y, uint8_t h, uint8_t color )

Draws vertical line.


Definition at line 386 of file Arduboy.cpp.
References HEIGHT.
Referenced by fillCircle().
Here is the caller graph for this function:

9.1.3.15 void Arduboy::drawLine ( int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint8_t color )

Draws a line between two points.


Uses Bresenham's algorithm.
Definition at line 326 of file Arduboy.cpp.
References dx, and dy.
Referenced by enterInitials().
Here is the caller graph for this function:

9.1.3.16 void Arduboy::drawPixel ( int x, int y, uint8_t color )

Sets a single pixel on the screen buffer to white or black.


Definition at line 172 of file Arduboy.cpp.
References HEIGHT, sBuffer, WIDTH, and x.
Referenced by drawBall(), drawCircle(), drawGameOver(), and newLevel().
Here is the caller graph for this function:

9.1.3.17 void Arduboy::drawRect ( int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color )

Draws a rectangle of a width and height.


Definition at line 377 of file Arduboy.cpp.
Referenced by drawPaddle(), moveBall(), and newLevel().
Here is the caller graph for this function:

9.1.3.18 void Arduboy::drawRoundRect ( int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color )

Draws a rectangle with rounded edges.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.1 Arduboy Class Reference 25

Definition at line 454 of file Arduboy.cpp.

9.1.3.19 void Arduboy::drawSlowXYBitmap ( int16_t x, int16_t y, const uint8_t ∗ bitmap, uint8_t w, uint8_t h, uint8_t color )

Draws images that are bit-oriented horizontally.


This requires a lot of additional CPU power and will draw images slower than drawBitmap, where the images are
stored in a format that allows them to be directly written to the screen. It is recommended you use drawBitmap
when possible.
Definition at line 631 of file Arduboy.cpp.
References HEIGHT, and WIDTH.

9.1.3.20 void Arduboy::drawTriangle ( int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color )

Draws the outline of a triangle.


Definition at line 480 of file Arduboy.cpp.

9.1.3.21 bool Arduboy::everyXFrames ( uint8_t frames )

Definition at line 94 of file Arduboy.cpp.


References frameCount.

9.1.3.22 void Arduboy::fillCircle ( int16_t x0, int16_t y0, uint8_t r, uint8_t color )

Draws a filled-in circle.


Definition at line 281 of file Arduboy.cpp.
References drawFastVLine(), and fillCircleHelper().
Here is the call graph for this function:

9.1.3.23 void Arduboy::fillCircleHelper ( int16_t x0, int16_t y0, uint8_t r, uint8_t cornername, int16_t delta, uint8_t color )

Draws one or both vertical halves of a filled-in circle.


Definition at line 288 of file Arduboy.cpp.
References x, and y.
Referenced by fillCircle().
Here is the caller graph for this function:

9.1.3.24 void Arduboy::fillRect ( int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color )

Draws a filled-in rectangle.


Definition at line 406 of file Arduboy.cpp.
Referenced by pause().
Here is the caller graph for this function:

9.1.3.25 void Arduboy::fillRoundRect ( int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t r, uint8_t color )

Draws a filled-in rectangle with rounded edges.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


26 Data Structure Documentation

Definition at line 469 of file Arduboy.cpp.

9.1.3.26 void Arduboy::fillScreen ( uint8_t color )

Fills the screen buffer with white or black.


Definition at line 415 of file Arduboy.cpp.
References sBuffer.
Referenced by clear().
Here is the caller graph for this function:

9.1.3.27 void Arduboy::fillTriangle ( int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color )

Draws a filled-in triangle.


Definition at line 488 of file Arduboy.cpp.
References y.

9.1.3.28 unsigned char ∗ Arduboy::getBuffer ( )

Definition at line 736 of file Arduboy.cpp.


References sBuffer.

9.1.3.29 uint8_t Arduboy::getPixel ( uint8_t x, uint8_t y )

Definition at line 192 of file Arduboy.cpp.


References sBuffer, and WIDTH.

9.1.3.30 void Arduboy::initRandomSeed ( )

Seeds the random number generator with entropy from the temperature, voltage reading, and microseconds since
boot.
This method is still most effective when called semi-randomly such as after a user hits a button to start a game or
other semi-random events
Definition at line 138 of file Arduboy.cpp.
References ADC_TEMP, ADC_VOLTAGE, and rawADC().
Here is the call graph for this function:

9.1.3.31 bool Arduboy::nextFrame ( )

Definition at line 99 of file Arduboy.cpp.


References eachFrameMillis, frameCount, ArduboyCore::idle(), lastFrameDurationMs, lastFrameStart, nextFrame←-
Start, and post_render.
Referenced by loop().
Here is the call graph for this function:
Here is the caller graph for this function:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.1 Arduboy Class Reference 27

9.1.3.32 boolean Arduboy::notPressed ( uint8_t buttons )

Returns true if the button mask passed in not pressed.


if (notPressed(LEFT_BUTTON))
Definition at line 747 of file Arduboy.cpp.
References ArduboyCore::buttonsState().
Here is the call graph for this function:

9.1.3.33 boolean Arduboy::pressed ( uint8_t buttons )

Returns true if the button mask passed in is pressed.


if (pressed(LEFT_BUTTON + A_BUTTON))
Definition at line 742 of file Arduboy.cpp.
References ArduboyCore::buttonsState().
Referenced by bootUtils(), enterInitials(), loop(), moveBall(), movePaddle(), pause(), and pollFireButton().
Here is the call graph for this function:
Here is the caller graph for this function:

9.1.3.34 uint16_t Arduboy::rawADC ( byte adc_bits )

useful for getting raw approximate voltage values


Definition at line 145 of file Arduboy.cpp.
References ADC_TEMP.
Referenced by initRandomSeed().
Here is the caller graph for this function:

9.1.3.35 void Arduboy::setCursor ( int16_t x, int16_t y )

Sets the location of the screen cursor.


Definition at line 690 of file Arduboy.cpp.
References cursor_x, cursor_y, x, and y.
Referenced by displayHighScores(), drawGameOver(), drawLives(), enterInitials(), intro(), loop(), newLevel(),
pause(), Score(), setup(), and titleScreen().
Here is the caller graph for this function:

9.1.3.36 void Arduboy::setFrameRate ( uint8_t rate )

Definition at line 88 of file Arduboy.cpp.


References eachFrameMillis, and frameRate.
Referenced by Arduboy(), and setup().
Here is the caller graph for this function:

9.1.3.37 void Arduboy::setTextSize ( uint8_t s )

Set text size.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


28 Data Structure Documentation

As mentioned in drawChar(), individual ASCII characters are 6x8 pixels (5x7 with spacing on two edges). The size
is a pixel multiplier, so a size of 2 means each character will be 12x16, etc.
Definition at line 696 of file Arduboy.cpp.
References textsize.
Referenced by setup(), and titleScreen().
Here is the caller graph for this function:

9.1.3.38 void Arduboy::setTextWrap ( boolean w )

Sets whether text will wrap at screen edges.


Definition at line 702 of file Arduboy.cpp.
References wrap.

9.1.3.39 void Arduboy::start ( )

Definition at line 22 of file Arduboy.cpp.


References begin().
Here is the call graph for this function:

9.1.3.40 void Arduboy::swap ( int16_t & a, int16_t & b )

Swap the references of two pointers.


Definition at line 752 of file Arduboy.cpp.

9.1.3.41 size_t Arduboy::write ( uint8_t c ) [virtual]

Writes a single ASCII character to the screen.


Definition at line 707 of file Arduboy.cpp.
References cursor_x, cursor_y, drawChar(), textsize, WIDTH, and wrap.
Here is the call graph for this function:

9.1.4 Field Documentation

9.1.4.1 ArduboyAudio Arduboy::audio

Definition at line 168 of file Arduboy.h.


Referenced by begin(), and beginNoLogo().

9.1.4.2 int16_t Arduboy::cursor_x [protected]

Definition at line 199 of file Arduboy.h.


Referenced by Arduboy(), setCursor(), and write().

9.1.4.3 int16_t Arduboy::cursor_y [protected]

Definition at line 200 of file Arduboy.h.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.1 Arduboy Class Reference 29

Referenced by Arduboy(), setCursor(), and write().

9.1.4.4 uint8_t Arduboy::eachFrameMillis

Definition at line 184 of file Arduboy.h.


Referenced by cpuLoad(), nextFrame(), and setFrameRate().

9.1.4.5 uint16_t Arduboy::frameCount

Definition at line 183 of file Arduboy.h.


Referenced by Arduboy(), everyXFrames(), and nextFrame().

9.1.4.6 uint8_t Arduboy::frameRate

Definition at line 182 of file Arduboy.h.


Referenced by setFrameRate().

9.1.4.7 uint8_t Arduboy::lastFrameDurationMs

Definition at line 188 of file Arduboy.h.


Referenced by cpuLoad(), and nextFrame().

9.1.4.8 long Arduboy::lastFrameStart

Definition at line 185 of file Arduboy.h.


Referenced by nextFrame().

9.1.4.9 long Arduboy::nextFrameStart

Definition at line 186 of file Arduboy.h.


Referenced by Arduboy(), and nextFrame().

9.1.4.10 bool Arduboy::post_render

Definition at line 187 of file Arduboy.h.


Referenced by Arduboy(), and nextFrame().

9.1.4.11 unsigned char Arduboy::sBuffer[(HEIGHT ∗WIDTH)/8] [protected]

Definition at line 194 of file Arduboy.h.


Referenced by display(), drawPixel(), fillScreen(), getBuffer(), and getPixel().

9.1.4.12 uint8_t Arduboy::textsize [protected]

Definition at line 201 of file Arduboy.h.


Referenced by Arduboy(), setTextSize(), and write().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


30 Data Structure Documentation

9.1.4.13 ArduboyTunes Arduboy::tunes

Definition at line 167 of file Arduboy.h.


Referenced by begin(), beginNoLogo(), enterInitials(), intro(), loop(), and moveBall().

9.1.4.14 boolean Arduboy::wrap [protected]

Definition at line 202 of file Arduboy.h.


Referenced by setTextWrap(), and write().
The documentation for this class was generated from the following files:

• Arduboy/src/Arduboy.h
• Arduboy/src/Arduboy.cpp

9.2 ArduboyAudio Class Reference

#include <audio.h>
Collaboration diagram for ArduboyAudio:

Static Public Member Functions

• static void begin ()


• static void on ()
• static void off ()
• static void saveOnOff ()
• static bool enabled ()

Static Protected Attributes

• static bool audio_enabled = false

9.2.1 Detailed Description

Definition at line 16 of file audio.h.

9.2.2 Member Function Documentation

9.2.2.1 void ArduboyAudio::begin ( ) [static]

Definition at line 68 of file audio.cpp.


References EEPROM_AUDIO_ON_OFF, on(), and tune_playing.
Referenced by Arduboy::begin(), and Arduboy::beginNoLogo().
Here is the call graph for this function:
Here is the caller graph for this function:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.3 ArduboyCore Class Reference 31

9.2.2.2 bool ArduboyAudio::enabled ( ) [static]

Definition at line 51 of file audio.cpp.


References audio_enabled.

9.2.2.3 void ArduboyAudio::off ( ) [static]

Definition at line 56 of file audio.cpp.


References audio_enabled.

9.2.2.4 void ArduboyAudio::on ( ) [static]

Definition at line 44 of file audio.cpp.


References audio_enabled.
Referenced by begin().
Here is the caller graph for this function:

9.2.2.5 void ArduboyAudio::saveOnOff ( ) [static]

Definition at line 63 of file audio.cpp.


References audio_enabled, and EEPROM_AUDIO_ON_OFF.

9.2.3 Field Documentation

9.2.3.1 bool ArduboyAudio::audio_enabled = false [static], [protected]

Definition at line 26 of file audio.h.


Referenced by enabled(), off(), on(), and saveOnOff().
The documentation for this class was generated from the following files:

• Arduboy/src/audio/audio.h
• Arduboy/src/audio/audio.cpp

9.3 ArduboyCore Class Reference

#include <core.h>
Inheritance diagram for ArduboyCore:
Collaboration diagram for ArduboyCore:

Public Member Functions

• ArduboyCore ()
• void setRGBled (uint8_t red, uint8_t green, uint8_t blue)
set the light output of the RGB LEB

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


32 Data Structure Documentation

Static Public Member Functions

• static void idle ()


allows the CPU to idle between frames
• static void LCDDataMode ()
• static void LCDCommandMode ()
put the display in command mode
• static uint8_t width ()
• static uint8_t height ()
• static uint8_t getInput ()
get current state of all buttons (bitmask)
• static uint8_t buttonsState ()
• static void paint8Pixels (uint8_t pixels)
• static void paintScreen (const unsigned char ∗image)
paints an entire image directly to hardware (from PROGMEM)
• static void paintScreen (unsigned char image[ ])
paints an entire image directly to hardware (from RAM)
• static void blank ()
paints a blank (black) screen to hardware
• static void invert (boolean inverse)
invert the display or set to normal
• static void allPixelsOn (boolean on)
turn all display pixels on, or display the buffer contents
• static void flipVertical (boolean flipped)
flip the display vertically or set to normal
• static void flipHorizontal (boolean flipped)
flip the display horizontally or set to normal
• static void sendLCDCommand (uint8_t command)
send a single byte command to the OLED

Static Protected Member Functions

• static void boot ()


boots the hardware
• static void safeMode ()
Safe mode.
• static void bootLCD ()
• static void bootPins ()
• static void slowCPU ()
• static void saveMuchPower ()

Static Private Attributes

• static volatile uint8_t ∗ mosiport


• static volatile uint8_t ∗ csport
• static volatile uint8_t ∗ dcport
• static uint8_t mosipinmask
• static uint8_t cspinmask
• static uint8_t dcpinmask

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.3 ArduboyCore Class Reference 33

9.3.1 Detailed Description

Definition at line 136 of file core.h.

9.3.2 Constructor & Destructor Documentation

9.3.2.1 ArduboyCore::ArduboyCore ( )

Definition at line 90 of file core.cpp.

9.3.3 Member Function Documentation

9.3.3.1 void ArduboyCore::allPixelsOn ( boolean on ) [static]

turn all display pixels on, or display the buffer contents


when set to all pixels on, the display buffer will be ignored but not altered
Definition at line 268 of file core.cpp.
References OLED_ALL_PIXELS_ON, OLED_PIXELS_FROM_RAM, and sendLCDCommand().
Here is the call graph for this function:

9.3.3.2 void ArduboyCore::blank ( ) [static]

paints a blank (black) screen to hardware


Definition at line 246 of file core.cpp.
References HEIGHT, and WIDTH.
Referenced by Arduboy::bootUtils(), and safeMode().
Here is the caller graph for this function:

9.3.3.3 void ArduboyCore::boot ( ) [static], [protected]

boots the hardware

• sets input/output/pullup mode for pins

• powers up the OLED screen and initializes it properly

• sets up power saving

• kicks CPU down to 8Mhz if needed

• allows Safe mode to be entered

Definition at line 92 of file core.cpp.


References bootLCD(), bootPins(), buttonsState(), LEFT_BUTTON, safeMode(), saveMuchPower(), slowCPU(),
and UP_BUTTON.
Referenced by Arduboy::begin(), and Arduboy::beginNoLogo().
Here is the call graph for this function:
Here is the caller graph for this function:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


34 Data Structure Documentation

9.3.3.4 void ArduboyCore::bootLCD ( ) [inline], [static], [protected]

Definition at line 142 of file core.cpp.


References CS, cspinmask, csport, DC, dcpinmask, dcport, lcdBootProgram, LCDCommandMode(), and LCD←-
DataMode().
Referenced by boot().
Here is the call graph for this function:
Here is the caller graph for this function:

9.3.3.5 void ArduboyCore::bootPins ( ) [inline], [static], [protected]

Definition at line 123 of file core.cpp.


References pinBootProgram, and RST.
Referenced by boot().
Here is the caller graph for this function:

9.3.3.6 uint8_t ArduboyCore::buttonsState ( ) [static]

Definition at line 311 of file core.cpp.


Referenced by boot(), getInput(), Arduboy::notPressed(), and Arduboy::pressed().
Here is the caller graph for this function:

9.3.3.7 void ArduboyCore::flipHorizontal ( boolean flipped ) [static]

flip the display horizontally or set to normal


Definition at line 283 of file core.cpp.
References OLED_HORIZ_FLIPPED, OLED_HORIZ_NORMAL, and sendLCDCommand().
Here is the call graph for this function:

9.3.3.8 void ArduboyCore::flipVertical ( boolean flipped ) [static]

flip the display vertically or set to normal


Definition at line 274 of file core.cpp.
References OLED_VERTICAL_FLIPPED, OLED_VERTICAL_NORMAL, and sendLCDCommand().
Here is the call graph for this function:

9.3.3.9 uint8_t ArduboyCore::getInput ( ) [static]

get current state of all buttons (bitmask)


Bit mask that is returned:

Hi Low

DevKit 00000000 - reserved -DLU-RAB D down U up 1.0 00000000 L left URLDAB– R right
Of course you shouldn't worry about bits (they may change with future hardware revisions) and should instead use
the button defines: LEFT_BUTTON, A_BUTTON, UP_BUTTON, etc.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.3 ArduboyCore Class Reference 35

Definition at line 305 of file core.cpp.


References buttonsState().
Here is the call graph for this function:

9.3.3.10 uint8_t ArduboyCore::height ( ) [static]

Definition at line 208 of file core.cpp.


References HEIGHT.

9.3.3.11 void ArduboyCore::idle ( ) [static]

allows the CPU to idle between frames


This puts the CPU in "Idle" sleep mode. You should call this as often as you can for the best power savings. The
timer 0 overflow interrupt will wake up the chip every 1ms - so even at 60 FPS a well written app should be able to
sleep maybe half the time in between rendering it's own frames.
See the Arduboy class nextFrame() for an example of how to use idle() in a frame loop.
Definition at line 187 of file core.cpp.
Referenced by Arduboy::nextFrame().
Here is the caller graph for this function:

9.3.3.12 void ArduboyCore::invert ( boolean inverse ) [static]

invert the display or set to normal


when inverted, a pixel set to 0 will be on
Definition at line 261 of file core.cpp.
References OLED_PIXELS_INVERTED, OLED_PIXELS_NORMAL, and sendLCDCommand().
Referenced by loop().
Here is the call graph for this function:
Here is the caller graph for this function:

9.3.3.13 void ArduboyCore::LCDCommandMode ( ) [static]

put the display in command mode


See SSD1306 documents for available commands and command sequences.
Links:

• https://www.adafruit.com/datasheets/SSD1306.pdf

• http://www.eimodule.com/download/SSD1306-OLED-Controller.pdf

Definition at line 167 of file core.cpp.


References cspinmask, csport, dcpinmask, and dcport.
Referenced by bootLCD(), and sendLCDCommand().
Here is the caller graph for this function:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


36 Data Structure Documentation

9.3.3.14 void ArduboyCore::LCDDataMode ( ) [static]

Definition at line 161 of file core.cpp.


References cspinmask, csport, dcpinmask, and dcport.
Referenced by bootLCD(), and sendLCDCommand().
Here is the caller graph for this function:

9.3.3.15 void ArduboyCore::paint8Pixels ( uint8_t pixels ) [static]

Definition at line 213 of file core.cpp.

9.3.3.16 void ArduboyCore::paintScreen ( const unsigned char ∗ image ) [static]

paints an entire image directly to hardware (from PROGMEM)


Definition at line 218 of file core.cpp.
References HEIGHT, and WIDTH.
Referenced by Arduboy::display().
Here is the caller graph for this function:

9.3.3.17 void ArduboyCore::paintScreen ( unsigned char image[ ] ) [static]

paints an entire image directly to hardware (from RAM)


Definition at line 228 of file core.cpp.
References HEIGHT, and WIDTH.

9.3.3.18 void ArduboyCore::safeMode ( ) [inline], [static], [protected]

Safe mode.
Safe Mode is engaged by holding down both the LEFT button and UP button when plugging the device into USB. It
puts your device into a tight loop and allows it to be reprogrammed even if you have uploaded a very broken sketch
that interferes with the normal USB triggered auto-reboot functionality of the device.
This is most useful on Devkits because they lack a built-in reset button.
Definition at line 176 of file core.cpp.
References blank().
Referenced by boot().
Here is the call graph for this function:
Here is the caller graph for this function:

9.3.3.19 void ArduboyCore::saveMuchPower ( ) [inline], [static], [protected]

Definition at line 193 of file core.cpp.


Referenced by boot().
Here is the caller graph for this function:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.3 ArduboyCore Class Reference 37

9.3.3.20 void ArduboyCore::sendLCDCommand ( uint8_t command ) [static]

send a single byte command to the OLED


Definition at line 252 of file core.cpp.
References LCDCommandMode(), and LCDDataMode().
Referenced by allPixelsOn(), flipHorizontal(), flipVertical(), and invert().
Here is the call graph for this function:
Here is the caller graph for this function:

9.3.3.21 void ArduboyCore::setRGBled ( uint8_t red, uint8_t green, uint8_t blue )

set the light output of the RGB LEB


Definition at line 290 of file core.cpp.
References BLUE_LED, GREEN_LED, and RED_LED.
Referenced by Arduboy::bootLogo(), and Arduboy::bootUtils().
Here is the caller graph for this function:

9.3.3.22 static void ArduboyCore::slowCPU ( ) [inline], [static], [protected]

Referenced by boot().
Here is the caller graph for this function:

9.3.3.23 uint8_t ArduboyCore::width ( ) [static]

Definition at line 206 of file core.cpp.


References WIDTH.

9.3.4 Field Documentation

9.3.4.1 uint8_t ArduboyCore::cspinmask [static], [private]

Definition at line 294 of file core.h.


Referenced by bootLCD(), LCDCommandMode(), and LCDDataMode().

9.3.4.2 volatile uint8_t ∗ ArduboyCore::csport [static], [private]

Definition at line 289 of file core.h.


Referenced by bootLCD(), LCDCommandMode(), and LCDDataMode().

9.3.4.3 uint8_t ArduboyCore::dcpinmask [static], [private]

Definition at line 294 of file core.h.


Referenced by bootLCD(), LCDCommandMode(), and LCDDataMode().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


38 Data Structure Documentation

9.3.4.4 volatile uint8_t ∗ ArduboyCore::dcport [static], [private]

Definition at line 289 of file core.h.


Referenced by bootLCD(), LCDCommandMode(), and LCDDataMode().

9.3.4.5 uint8_t ArduboyCore::mosipinmask [static], [private]

Definition at line 294 of file core.h.

9.3.4.6 volatile uint8_t ∗ ArduboyCore::mosiport [static], [private]

Definition at line 289 of file core.h.


The documentation for this class was generated from the following files:

• Arduboy/src/core/core.h
• Arduboy/src/core/core.cpp

9.4 ArduboyTunes Class Reference

#include <audio.h>
Collaboration diagram for ArduboyTunes:

Public Member Functions

• void initChannel (byte pin)


Assign a timer to an output pin.
• void playScore (const byte ∗score)
Start playing a polyphonic score.
• void stopScore ()
Stop playing the score.
• void delay (unsigned msec)
Delay in milliseconds.
• void closeChannels ()
Stop all timers.
• bool playing ()
• void tone (unsigned int frequency, unsigned long duration)

Static Public Member Functions

• static void step ()


• static void soundOutput ()

Static Private Member Functions

• static void playNote (byte chan, byte note)


• static void stopNote (byte chan)

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.4 ArduboyTunes Class Reference 39

9.4.1 Detailed Description

Definition at line 30 of file audio.h.

9.4.2 Member Function Documentation

9.4.2.1 void ArduboyTunes::closeChannels ( void )

Stop all timers.


Definition at line 231 of file audio.cpp.
References _tune_num_chans, _tune_pins, tune_pin_to_timer_PGM, and tune_playing.

9.4.2.2 void ArduboyTunes::delay ( unsigned msec )

Delay in milliseconds.

9.4.2.3 void ArduboyTunes::initChannel ( byte pin )

Assign a timer to an output pin.


Definition at line 77 of file audio.cpp.
References _tune_num_chans, _tune_pins, _tunes_timer1_pin_mask, _tunes_timer1_pin_port, _tunes_timer3_←-
pin_mask, _tunes_timer3_pin_port, AVAILABLE_TIMERS, playNote(), stopNote(), and tune_pin_to_timer_PGM.
Referenced by Arduboy::begin(), and Arduboy::beginNoLogo().
Here is the call graph for this function:
Here is the caller graph for this function:

9.4.2.4 bool ArduboyTunes::playing ( )

Definition at line 190 of file audio.cpp.


References tune_playing.
Referenced by loop().
Here is the caller graph for this function:

9.4.2.5 void ArduboyTunes::playNote ( byte chan, byte note ) [static], [private]

Definition at line 111 of file audio.cpp.


References _midi_byte_note_frequencies, _midi_word_note_frequencies, _tune_num_chans, tune_pin_to_timer←-
_PGM, wait_timer_frequency2, and wait_timer_playing.
Referenced by initChannel(), and step().
Here is the caller graph for this function:

9.4.2.6 void ArduboyTunes::playScore ( const byte ∗ score )

Start playing a polyphonic score.


Definition at line 175 of file audio.cpp.
References score, score_cursor, score_start, step(), and tune_playing.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


40 Data Structure Documentation

Referenced by loop().
Here is the call graph for this function:
Here is the caller graph for this function:

9.4.2.7 void ArduboyTunes::soundOutput ( ) [static]

Definition at line 250 of file audio.cpp.


References _tunes_timer3_pin_mask, _tunes_timer3_pin_port, step(), tune_playing, wait_timer_playing, and
wait_toggle_count.
Referenced by ISR().
Here is the call graph for this function:
Here is the caller graph for this function:

9.4.2.8 void ArduboyTunes::step ( ) [static]

Definition at line 200 of file audio.cpp.


References playNote(), score_cursor, score_start, stopNote(), TUNE_OP_PLAYNOTE, TUNE_OP_RESTART, T←-
UNE_OP_STOP, TUNE_OP_STOPNOTE, tune_playing, wait_timer_frequency2, and wait_toggle_count.
Referenced by playScore(), and soundOutput().
Here is the call graph for this function:
Here is the caller graph for this function:

9.4.2.9 void ArduboyTunes::stopNote ( byte chan ) [static], [private]

Definition at line 159 of file audio.cpp.


References _tunes_timer1_pin_mask, _tunes_timer1_pin_port, _tunes_timer3_pin_mask, _tunes_timer3_pin_port,
tune_pin_to_timer_PGM, and wait_timer_playing.
Referenced by initChannel(), step(), and stopScore().
Here is the caller graph for this function:

9.4.2.10 void ArduboyTunes::stopScore ( void )

Stop playing the score.


Definition at line 183 of file audio.cpp.
References _tune_num_chans, stopNote(), and tune_playing.
Here is the call graph for this function:

9.4.2.11 void ArduboyTunes::tone ( unsigned int frequency, unsigned long duration )

Definition at line 261 of file audio.cpp.


References timer1_toggle_count, and tonePlaying.
Referenced by enterInitials(), intro(), and moveBall().
Here is the caller graph for this function:
The documentation for this class was generated from the following files:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


9.5 Print Class Reference 41

• Arduboy/src/audio/audio.h
• Arduboy/src/audio/audio.cpp

9.5 Print Class Reference

Inheritance diagram for Print:


Collaboration diagram for Print:
The documentation for this class was generated from the following file:

• Arduboy/src/Arduboy.h

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


42 Data Structure Documentation

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


Chapter 10

File Documentation

10.1 Arduboy/CONTRIBUTORS.md File Reference

10.2 Arduboy/examples/ArduBreakout/ArduBreakout.ino File Reference

#include "Arduboy.h"
#include "breakout_bitmaps.h"
#include "pins_arduino.h"
Include dependency graph for ArduBreakout.ino:

10.3 Arduboy/examples/ArduBreakout/breakout_bitmaps.cpp File Reference

#include "breakout_bitmaps.h"
Include dependency graph for breakout_bitmaps.cpp:

Variables

• PROGMEM const unsigned char title [ ]


• PROGMEM const unsigned char fire [ ]
• PROGMEM const unsigned char arrow [ ]

10.3.1 Variable Documentation

10.3.1.1 PROGMEM const unsigned char arrow[ ]

Initial value:

=
{
5,5,
0x20,
0x10,
0xF8,
0x10,
0x20,
}

Definition at line 116 of file breakout_bitmaps.cpp.


44 File Documentation

10.3.1.2 PROGMEM const unsigned char fire[ ]

Initial value:

=
{
57,8,
0xF8,0x00,0x00,0x00,0x3D,0xEF,0x8F,0x80,
0xCC,0x00,0x00,0x00,0x60,0xCC,0xD8,0x00,
0xCC,0x00,0x00,0x00,0x60,0xCC,0xD8,0x00,
0xF9,0x67,0x1E,0x78,0x78,0xCF,0x9F,0x00,
0xC1,0x8C,0xA0,0x80,0x60,0xCC,0xD8,0x00,
0xC1,0x8F,0x1C,0x70,0x60,0xCC,0xD8,0x00,
0xC1,0x8C,0x02,0x08,0x60,0xCC,0xDF,0x80,
0xC1,0x87,0xBC,0xF0,0x61,0xEC,0xCF,0x80,
}

Definition at line 103 of file breakout_bitmaps.cpp.

10.3.1.3 PROGMEM const unsigned char title[ ]

Definition at line 3 of file breakout_bitmaps.cpp.

10.4 Arduboy/examples/ArduBreakout/breakout_bitmaps.h File Reference

#include <avr/pgmspace.h>
Include dependency graph for breakout_bitmaps.h: This graph shows which files directly or indirectly include this
file:

Variables

• const unsigned char fire [ ]


• const unsigned char title [ ]
• const unsigned char arrow [ ]

10.4.1 Variable Documentation

10.4.1.1 const unsigned char arrow[ ]

Definition at line 116 of file breakout_bitmaps.cpp.

10.4.1.2 const unsigned char fire[ ]

Definition at line 103 of file breakout_bitmaps.cpp.

10.4.1.3 const unsigned char title[ ]

Definition at line 3 of file breakout_bitmaps.cpp.

10.5 Arduboy/examples/ArduBreakout/README.md File Reference

10.6 Arduboy/examples/HelloWorld/README.md File Reference

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.7 Arduboy/examples/Tunes/README.md File Reference 45

10.7 Arduboy/examples/Tunes/README.md File Reference

10.8 Arduboy/README.md File Reference

10.9 Arduboy/examples/Buttons/Buttons.ino File Reference

#include "Arduboy.h"
Include dependency graph for Buttons.ino:

Macros

• #define CHAR_WIDTH 6
• #define CHAR_HEIGHT 8
• #define NUM_CHARS (sizeof(text) - 1)
• #define X_MAX (WIDTH - (NUM_CHARS ∗ CHAR_WIDTH) + 1)
• #define Y_MAX (HEIGHT - CHAR_HEIGHT)

Functions

• void setup ()
• void loop ()

Variables

• Arduboy arduboy
• char text [ ] = "Press Buttons!"
• byte x
• byte y

10.9.1 Macro Definition Documentation

10.9.1.1 #define CHAR_HEIGHT 8

Definition at line 29 of file Buttons.ino.


Referenced by setup().

10.9.1.2 #define CHAR_WIDTH 6

Definition at line 26 of file Buttons.ino.


Referenced by setup().

10.9.1.3 #define NUM_CHARS (sizeof(text) - 1)

Definition at line 33 of file Buttons.ino.


Referenced by setup().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


46 File Documentation

10.9.1.4 #define X_MAX (WIDTH - (NUM_CHARS ∗ CHAR_WIDTH) + 1)

Definition at line 39 of file Buttons.ino.


Referenced by loop().

10.9.1.5 #define Y_MAX (HEIGHT - CHAR_HEIGHT)

Definition at line 43 of file Buttons.ino.


Referenced by loop().

10.9.2 Function Documentation

10.9.2.1 void loop ( )

Definition at line 64 of file Buttons.ino.


References A_BUTTON, B_BUTTON, Arduboy::clear(), Arduboy::display(), DOWN_BUTTON, LEFT_BUTTON,
Arduboy::nextFrame(), Arduboy::pressed(), RIGHT_BUTTON, Arduboy::setCursor(), text, UP_BUTTON, x, X_MAX,
y, and Y_MAX.
Here is the call graph for this function:

10.9.2.2 void setup ( )

Definition at line 48 of file Buttons.ino.


References Arduboy::begin(), CHAR_HEIGHT, CHAR_WIDTH, HEIGHT, NUM_CHARS, Arduboy::setFrameRate(),
WIDTH, x, and y.
Here is the call graph for this function:

10.9.3 Variable Documentation

10.9.3.1 Arduboy arduboy

Definition at line 18 of file Buttons.ino.

10.9.3.2 char text[ ] = "Press Buttons!"

Definition at line 21 of file Buttons.ino.


Referenced by loop().

10.9.3.3 byte x

Definition at line 22 of file Buttons.ino.


Referenced by displayHighScores(), Arduboy::drawCircle(), Arduboy::drawCircleHelper(), Arduboy::drawPixel(),
Arduboy::fillCircleHelper(), loop(), Arduboy::setCursor(), and setup().

10.9.3.4 byte y

Definition at line 23 of file Buttons.ino.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.10 Arduboy/examples/HelloWorld/HelloWorld.ino File Reference 47

Referenced by Arduboy::bootLogo(), displayHighScores(), Arduboy::drawCircle(), Arduboy::drawCircleHelper(),


Arduboy::fillCircleHelper(), Arduboy::fillTriangle(), loop(), Arduboy::setCursor(), and setup().

10.10 Arduboy/examples/HelloWorld/HelloWorld.ino File Reference

#include "Arduboy.h"
Include dependency graph for HelloWorld.ino:

Functions

• void setup ()
• void loop ()

Variables

• Arduboy arduboy

10.10.1 Function Documentation

10.10.1.1 void loop ( )

Definition at line 34 of file HelloWorld.ino.


References Arduboy::clear(), Arduboy::display(), Arduboy::nextFrame(), and Arduboy::setCursor().
Here is the call graph for this function:

10.10.1.2 void setup ( )

Definition at line 22 of file HelloWorld.ino.


References Arduboy::begin(), and Arduboy::setFrameRate().
Here is the call graph for this function:

10.10.2 Variable Documentation

10.10.2.1 Arduboy arduboy

Definition at line 17 of file HelloWorld.ino.

10.11 Arduboy/examples/Tunes/Tunes.ino File Reference

#include "Arduboy.h"
Include dependency graph for Tunes.ino:

Functions

• void setup ()
• void loop ()

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


48 File Documentation

Variables

• const byte PROGMEM score [ ]


• Arduboy arduboy
• int x = 0
• int y = 0

10.11.1 Function Documentation

10.11.1.1 void loop ( )

Definition at line 171 of file Tunes.ino.


References A_BUTTON, B_BUTTON, Arduboy::clear(), Arduboy::display(), DOWN_BUTTON, ArduboyCore←-
::invert(), LEFT_BUTTON, Arduboy::nextFrame(), ArduboyTunes::playing(), ArduboyTunes::playScore(), Arduboy←-
::pressed(), RIGHT_BUTTON, score, Arduboy::setCursor(), Arduboy::tunes, UP_BUTTON, x, and y.
Here is the call graph for this function:

10.11.1.2 void setup ( )

Definition at line 159 of file Tunes.ino.


References Arduboy::begin(), Arduboy::display(), Arduboy::setCursor(), and Arduboy::setTextSize().
Here is the call graph for this function:

10.11.2 Variable Documentation

10.11.2.1 Arduboy arduboy

Definition at line 157 of file Tunes.ino.

10.11.2.2 const byte PROGMEM score[ ]

Definition at line 3 of file Tunes.ino.


Referenced by loop().

10.11.2.3 int x = 0

Definition at line 169 of file Tunes.ino.


Referenced by loop().

10.11.2.4 int y = 0

Definition at line 169 of file Tunes.ino.


Referenced by loop().

10.12 Arduboy/src/ab_logo.c File Reference

#include <avr/pgmspace.h>
Include dependency graph for ab_logo.c: This graph shows which files directly or indirectly include this file:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.13 Arduboy/src/Arduboy.cpp File Reference 49

Macros

• #define ARDUBOY_LOGO_CREATED

Variables

• PROGMEM const unsigned char arduboy_logo [ ]

10.12.1 Macro Definition Documentation

10.12.1.1 #define ARDUBOY_LOGO_CREATED

Definition at line 4 of file ab_logo.c.

10.12.2 Variable Documentation

10.12.2.1 PROGMEM const unsigned char arduboy_logo[ ]

Initial value:

= {
0xF0, 0xF8, 0x9C, 0x8E, 0x87, 0x83, 0x87, 0x8E, 0x9C, 0xF8,
0xF0, 0x00, 0x00, 0xFE, 0xFF, 0x03, 0x03, 0x03, 0x03, 0x03,
0x07, 0x0E, 0xFC, 0xF8, 0x00, 0x00, 0xFE, 0xFF, 0x03, 0x03,
0x03, 0x03, 0x03, 0x07, 0x0E, 0xFC, 0xF8, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xFE, 0xFF, 0x83, 0x83, 0x83, 0x83, 0x83, 0xC7,
0xEE, 0x7C, 0x38, 0x00, 0x00, 0xF8, 0xFC, 0x0E, 0x07, 0x03,
0x03, 0x03, 0x07, 0x0E, 0xFC, 0xF8, 0x00, 0x00, 0x3F, 0x7F,
0xE0, 0xC0, 0x80, 0x80, 0xC0, 0xE0, 0x7F, 0x3F, 0xFF, 0xFF,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0xFF, 0x00,
0x00, 0xFF, 0xFF, 0x0C, 0x0C, 0x0C, 0x0C, 0x1C, 0x3E, 0x77,
0xE3, 0xC1, 0x00, 0x00, 0x7F, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0,
0xC0, 0xE0, 0x70, 0x3F, 0x1F, 0x00, 0x00, 0x1F, 0x3F, 0x70,
0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0x70, 0x3F, 0x1F, 0x00, 0x00,
0x7F, 0xFF, 0xC1, 0xC1, 0xC1, 0xC1, 0xC1, 0xE3, 0x77, 0x3E,
0x1C, 0x00, 0x00, 0x1F, 0x3F, 0x70, 0xE0, 0xC0, 0xC0, 0xC0,
0xE0, 0x70, 0x3F, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00

Definition at line 8 of file ab_logo.c.


Referenced by Arduboy::bootLogo().

10.13 Arduboy/src/Arduboy.cpp File Reference

#include "Arduboy.h"
#include "glcdfont.c"
#include "ab_logo.c"
Include dependency graph for Arduboy.cpp:

10.14 Arduboy/src/Arduboy.h File Reference

#include "core/core.h"
#include <SPI.h>
#include <Print.h>
#include <limits.h>
#include "audio/audio.h"

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


50 File Documentation

Include dependency graph for Arduboy.h: This graph shows which files directly or indirectly include this file:

Data Structures

• class Arduboy

Macros

• #define EEPROM_VERSION 0
• #define EEPROM_BRIGHTNESS 1
• #define EEPROM_AUDIO_ON_OFF 2
• #define EEPROM_STORAGE_SPACE_START 16
• #define PIXEL_SAFE_MODE
• #define ADC_VOLTAGE (_BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1))
• #define ADC_TEMP (_BV(REFS0) | _BV(REFS1) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0))

10.14.1 Macro Definition Documentation

10.14.1.1 #define ADC_TEMP (_BV(REFS0) | _BV(REFS1) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0))

Definition at line 25 of file Arduboy.h.


Referenced by Arduboy::initRandomSeed(), and Arduboy::rawADC().

10.14.1.2 #define ADC_VOLTAGE (_BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1))

Definition at line 23 of file Arduboy.h.


Referenced by Arduboy::initRandomSeed().

10.14.1.3 #define EEPROM_AUDIO_ON_OFF 2

Definition at line 12 of file Arduboy.h.


Referenced by ArduboyAudio::begin(), and ArduboyAudio::saveOnOff().

10.14.1.4 #define EEPROM_BRIGHTNESS 1

Definition at line 11 of file Arduboy.h.

10.14.1.5 #define EEPROM_STORAGE_SPACE_START 16

Definition at line 15 of file Arduboy.h.

10.14.1.6 #define EEPROM_VERSION 0

Definition at line 10 of file Arduboy.h.

10.14.1.7 #define PIXEL_SAFE_MODE

Definition at line 20 of file Arduboy.h.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.15 Arduboy/src/audio/audio.cpp File Reference 51

10.15 Arduboy/src/audio/audio.cpp File Reference

#include "Arduboy.h"
#include "audio.h"
Include dependency graph for audio.cpp:

Functions

• ISR (TIMER1_COMPA_vect)
• ISR (TIMER3_COMPA_vect)

Variables

• const byte PROGMEM tune_pin_to_timer_PGM [ ] = { 3, 1 }


• volatile byte ∗ _tunes_timer1_pin_port
• volatile byte _tunes_timer1_pin_mask
• volatile int32_t timer1_toggle_count
• volatile byte ∗ _tunes_timer3_pin_port
• volatile byte _tunes_timer3_pin_mask
• byte _tune_pins [AVAILABLE_TIMERS]
• byte _tune_num_chans = 0
• volatile boolean tune_playing
• volatile unsigned wait_timer_frequency2
• volatile boolean wait_timer_playing = false
• volatile boolean tonePlaying = false
• volatile unsigned long wait_toggle_count
• volatile const byte ∗ score_start = 0
• volatile const byte ∗ score_cursor = 0
• const uint8_t PROGMEM _midi_byte_note_frequencies [48]
• const unsigned int PROGMEM _midi_word_note_frequencies [80]

10.15.1 Function Documentation

10.15.1.1 ISR ( TIMER1_COMPA_vect )

Definition at line 293 of file audio.cpp.


References _tunes_timer1_pin_mask, _tunes_timer1_pin_port, timer1_toggle_count, and tonePlaying.

10.15.1.2 ISR ( TIMER3_COMPA_vect )

Definition at line 313 of file audio.cpp.


References ArduboyTunes::soundOutput().
Here is the call graph for this function:

10.15.2 Variable Documentation

10.15.2.1 const uint8_t PROGMEM _midi_byte_note_frequencies[48]

Initial value:

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


52 File Documentation

= {
16,17,18,19,21,22,23,24,26,28,29,31,33,35,37,39,41,44,46,49,52,55,58,62,65,
69,73,78,82,87,92,98,104,110,117,123,131,139,147,156,165,175,185,196,208,220,
233,247
}

Definition at line 27 of file audio.cpp.


Referenced by ArduboyTunes::playNote().

10.15.2.2 const unsigned int PROGMEM _midi_word_note_frequencies[80]

Initial value:

= {
262,277,294,311,330,349,370,392,415,440,466,494,523,554,587,622,659,
698,740,784,831,880,932,988,1047,1109,1175,1245,1319,1397,1480,1568,1661,1760,
1865,1976,2093,2217,2349,2489,2637,2794,2960,3136,3322,3520,3729,3951,4186,
4435,4699,4978,5274,5588,5920,6272,6645,7040,7459,7902,8372,8870,9397,9956,
10548,11175,11840,12544,13290,14080,14917,15804,16744,17740,18795,19912,21096,
22351,23680,25088 }

Definition at line 32 of file audio.cpp.


Referenced by ArduboyTunes::playNote().

10.15.2.3 byte _tune_num_chans = 0

Definition at line 11 of file audio.cpp.


Referenced by ArduboyTunes::closeChannels(), ArduboyTunes::initChannel(), ArduboyTunes::playNote(), and
ArduboyTunes::stopScore().

10.15.2.4 byte _tune_pins[AVAILABLE_TIMERS]

Definition at line 10 of file audio.cpp.


Referenced by ArduboyTunes::closeChannels(), and ArduboyTunes::initChannel().

10.15.2.5 volatile byte _tunes_timer1_pin_mask

Definition at line 6 of file audio.cpp.


Referenced by ArduboyTunes::initChannel(), ISR(), and ArduboyTunes::stopNote().

10.15.2.6 volatile byte∗ _tunes_timer1_pin_port

Definition at line 5 of file audio.cpp.


Referenced by ArduboyTunes::initChannel(), ISR(), and ArduboyTunes::stopNote().

10.15.2.7 volatile byte _tunes_timer3_pin_mask

Definition at line 9 of file audio.cpp.


Referenced by ArduboyTunes::initChannel(), ArduboyTunes::soundOutput(), and ArduboyTunes::stopNote().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.15 Arduboy/src/audio/audio.cpp File Reference 53

10.15.2.8 volatile byte∗ _tunes_timer3_pin_port

Definition at line 8 of file audio.cpp.


Referenced by ArduboyTunes::initChannel(), ArduboyTunes::soundOutput(), and ArduboyTunes::stopNote().

10.15.2.9 volatile const byte∗ score_cursor = 0

Definition at line 20 of file audio.cpp.


Referenced by ArduboyTunes::playScore(), and ArduboyTunes::step().

10.15.2.10 volatile const byte∗ score_start = 0

Definition at line 19 of file audio.cpp.


Referenced by ArduboyTunes::playScore(), and ArduboyTunes::step().

10.15.2.11 volatile int32_t timer1_toggle_count

Definition at line 7 of file audio.cpp.


Referenced by ISR(), and ArduboyTunes::tone().

10.15.2.12 volatile boolean tonePlaying = false

Definition at line 15 of file audio.cpp.


Referenced by ISR(), and ArduboyTunes::tone().

10.15.2.13 const byte PROGMEM tune_pin_to_timer_PGM[ ] = { 3, 1 }

Definition at line 4 of file audio.cpp.


Referenced by ArduboyTunes::closeChannels(), ArduboyTunes::initChannel(), ArduboyTunes::playNote(), and
ArduboyTunes::stopNote().

10.15.2.14 volatile boolean tune_playing

Definition at line 12 of file audio.cpp.


Referenced by ArduboyAudio::begin(), ArduboyTunes::closeChannels(), ArduboyTunes::playing(), ArduboyTunes←-
::playScore(), ArduboyTunes::soundOutput(), ArduboyTunes::step(), and ArduboyTunes::stopScore().

10.15.2.15 volatile unsigned wait_timer_frequency2

Definition at line 13 of file audio.cpp.


Referenced by ArduboyTunes::playNote(), and ArduboyTunes::step().

10.15.2.16 volatile boolean wait_timer_playing = false

Definition at line 14 of file audio.cpp.


Referenced by ArduboyTunes::playNote(), ArduboyTunes::soundOutput(), and ArduboyTunes::stopNote().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


54 File Documentation

10.15.2.17 volatile unsigned long wait_toggle_count

Definition at line 16 of file audio.cpp.


Referenced by ArduboyTunes::soundOutput(), and ArduboyTunes::step().

10.16 Arduboy/src/audio/audio.h File Reference

#include <Arduino.h>
#include <EEPROM.h>
#include <avr/pgmspace.h>
#include <avr/power.h>
Include dependency graph for audio.h: This graph shows which files directly or indirectly include this file:

Data Structures

• class ArduboyAudio
• class ArduboyTunes

Macros

• #define AVAILABLE_TIMERS 2
• #define TUNE_OP_PLAYNOTE 0x90 /∗ play a note: low nibble is generator #, note is next byte ∗/
• #define TUNE_OP_STOPNOTE 0x80 /∗ stop a note: low nibble is generator # ∗/
• #define TUNE_OP_RESTART 0xe0 /∗ restart the score from the beginning ∗/
• #define TUNE_OP_STOP 0xf0 /∗ stop playing ∗/

10.16.1 Macro Definition Documentation

10.16.1.1 #define AVAILABLE_TIMERS 2

Definition at line 9 of file audio.h.


Referenced by ArduboyTunes::initChannel().

10.16.1.2 #define TUNE_OP_PLAYNOTE 0x90 /∗ play a note: low nibble is generator #, note is next byte ∗/

Definition at line 10 of file audio.h.


Referenced by ArduboyTunes::step().

10.16.1.3 #define TUNE_OP_RESTART 0xe0 /∗ restart the score from the beginning ∗/

Definition at line 12 of file audio.h.


Referenced by ArduboyTunes::step().

10.16.1.4 #define TUNE_OP_STOP 0xf0 /∗ stop playing ∗/

Definition at line 13 of file audio.h.


Referenced by ArduboyTunes::step().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.17 Arduboy/src/core/core.cpp File Reference 55

10.16.1.5 #define TUNE_OP_STOPNOTE 0x80 /∗ stop a note: low nibble is generator # ∗/

Definition at line 11 of file audio.h.


Referenced by ArduboyTunes::step().

10.17 Arduboy/src/core/core.cpp File Reference

#include "core.h"
Include dependency graph for core.cpp:

Macros

• #define OLED_HORIZ_FLIPPED 0xA0


• #define OLED_HORIZ_NORMAL 0xA1

Variables

• const uint8_t PROGMEM pinBootProgram [ ]


• const uint8_t PROGMEM lcdBootProgram [ ]

10.17.1 Macro Definition Documentation

10.17.1.1 #define OLED_HORIZ_FLIPPED 0xA0

Definition at line 279 of file core.cpp.


Referenced by ArduboyCore::flipHorizontal().

10.17.1.2 #define OLED_HORIZ_NORMAL 0xA1

Definition at line 280 of file core.cpp.


Referenced by ArduboyCore::flipHorizontal().

10.17.2 Variable Documentation

10.17.2.1 const uint8_t PROGMEM lcdBootProgram[ ]

Definition at line 25 of file core.cpp.


Referenced by ArduboyCore::bootLCD().

10.17.2.2 const uint8_t PROGMEM pinBootProgram[ ]

Initial value:

= {

PIN_LEFT_BUTTON, INPUT_PULLUP,
PIN_RIGHT_BUTTON, INPUT_PULLUP,
PIN_UP_BUTTON, INPUT_PULLUP,
PIN_DOWN_BUTTON, INPUT_PULLUP,
PIN_A_BUTTON, INPUT_PULLUP,
PIN_B_BUTTON, INPUT_PULLUP,

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


56 File Documentation

DC, OUTPUT,
CS, OUTPUT,
RST, OUTPUT,
0
}

Definition at line 9 of file core.cpp.


Referenced by ArduboyCore::bootPins().

10.18 Arduboy/src/core/core.h File Reference

#include <avr/power.h>
#include <SPI.h>
#include <avr/sleep.h>
#include <limits.h>
Include dependency graph for core.h: This graph shows which files directly or indirectly include this file:

Data Structures

• class ArduboyCore

Macros

• #define ARDUBOY_10
defaults to Arduboy Release 1.0 if not using a boards.txt file
• #define CS 12
• #define DC 4
• #define RST 6
• #define RED_LED 10
• #define GREEN_LED 11
• #define BLUE_LED 9
• #define TX_LED 30
• #define RX_LED 17
• #define PIN_LEFT_BUTTON A2
• #define PIN_RIGHT_BUTTON A1
• #define PIN_UP_BUTTON A0
• #define PIN_DOWN_BUTTON A3
• #define PIN_A_BUTTON 7
• #define PIN_B_BUTTON 8
• #define LEFT_BUTTON _BV(5)
• #define RIGHT_BUTTON _BV(6)
• #define UP_BUTTON _BV(7)
• #define DOWN_BUTTON _BV(4)
• #define A_BUTTON _BV(3)
• #define B_BUTTON _BV(2)
• #define PIN_SPEAKER_1 5
• #define PIN_SPEAKER_2 13
• #define PIN_SPEAKER_1_PORT &PORTC
• #define PIN_SPEAKER_2_PORT &PORTC
• #define PIN_SPEAKER_1_BITMASK _BV(6)
• #define PIN_SPEAKER_2_BITMASK _BV(7)
• #define OLED_PIXELS_INVERTED 0xA7
• #define OLED_PIXELS_NORMAL 0xA6

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.18 Arduboy/src/core/core.h File Reference 57

• #define OLED_ALL_PIXELS_ON 0xA5


• #define OLED_PIXELS_FROM_RAM 0xA4
• #define OLED_VERTICAL_FLIPPED 0xC0
• #define OLED_VERTICAL_NORMAL 0xC8
• #define COLUMN_ADDRESS_END (WIDTH - 1) & 0x7F
• #define PAGE_ADDRESS_END ((HEIGHT/8)-1) & 0x07
• #define WIDTH 128
• #define HEIGHT 64
• #define INVERT 2
• #define WHITE 1
• #define BLACK 0

10.18.1 Macro Definition Documentation

10.18.1.1 #define A_BUTTON _BV(3)

Definition at line 61 of file core.h.


Referenced by enterInitials(), loop(), moveBall(), pause(), and pollFireButton().

10.18.1.2 #define ARDUBOY_10

defaults to Arduboy Release 1.0 if not using a boards.txt file


we default to Arduboy Release 1.0 if a compile flag has not been passed to us from a boards.txt file
if you wish to compile for the devkit without using a boards.txt file simply comment out the ARDUBOY_10 define
and uncomment the AB_DEVKIT define like this:

// #define ARDUBOY_10
#define AB_DEVKIT

Definition at line 25 of file core.h.

10.18.1.3 #define B_BUTTON _BV(2)

Definition at line 62 of file core.h.


Referenced by enterInitials(), loop(), moveBall(), pause(), and pollFireButton().

10.18.1.4 #define BLACK 0

Definition at line 134 of file core.h.


Referenced by Arduboy::clear(), and Arduboy::drawBitmap().

10.18.1.5 #define BLUE_LED 9

Definition at line 44 of file core.h.


Referenced by ArduboyCore::setRGBled().

10.18.1.6 #define COLUMN_ADDRESS_END (WIDTH - 1) & 0x7F

Definition at line 126 of file core.h.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


58 File Documentation

10.18.1.7 #define CS 12

Definition at line 38 of file core.h.


Referenced by ArduboyCore::bootLCD().

10.18.1.8 #define DC 4

Definition at line 39 of file core.h.


Referenced by ArduboyCore::bootLCD().

10.18.1.9 #define DOWN_BUTTON _BV(4)

Definition at line 60 of file core.h.


Referenced by enterInitials(), and loop().

10.18.1.10 #define GREEN_LED 11

Definition at line 43 of file core.h.


Referenced by ArduboyCore::setRGBled().

10.18.1.11 #define HEIGHT 64

Definition at line 130 of file core.h.


Referenced by ArduboyCore::blank(), Arduboy::drawBitmap(), Arduboy::drawChar(), Arduboy::drawFastVLine(),
Arduboy::drawPixel(), Arduboy::drawSlowXYBitmap(), ArduboyCore::height(), ArduboyCore::paintScreen(), and
setup().

10.18.1.12 #define INVERT 2

Definition at line 132 of file core.h.

10.18.1.13 #define LEFT_BUTTON _BV(5)

Definition at line 57 of file core.h.


Referenced by ArduboyCore::boot(), enterInitials(), loop(), and movePaddle().

10.18.1.14 #define OLED_ALL_PIXELS_ON 0xA5

Definition at line 118 of file core.h.


Referenced by ArduboyCore::allPixelsOn().

10.18.1.15 #define OLED_PIXELS_FROM_RAM 0xA4

Definition at line 119 of file core.h.


Referenced by ArduboyCore::allPixelsOn().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.18 Arduboy/src/core/core.h File Reference 59

10.18.1.16 #define OLED_PIXELS_INVERTED 0xA7

Definition at line 115 of file core.h.


Referenced by ArduboyCore::invert().

10.18.1.17 #define OLED_PIXELS_NORMAL 0xA6

Definition at line 116 of file core.h.


Referenced by ArduboyCore::invert().

10.18.1.18 #define OLED_VERTICAL_FLIPPED 0xC0

Definition at line 121 of file core.h.


Referenced by ArduboyCore::flipVertical().

10.18.1.19 #define OLED_VERTICAL_NORMAL 0xC8

Definition at line 122 of file core.h.


Referenced by ArduboyCore::flipVertical().

10.18.1.20 #define PAGE_ADDRESS_END ((HEIGHT/8)-1) & 0x07

Definition at line 127 of file core.h.

10.18.1.21 #define PIN_A_BUTTON 7

Definition at line 53 of file core.h.

10.18.1.22 #define PIN_B_BUTTON 8

Definition at line 54 of file core.h.

10.18.1.23 #define PIN_DOWN_BUTTON A3

Definition at line 52 of file core.h.

10.18.1.24 #define PIN_LEFT_BUTTON A2

Definition at line 49 of file core.h.

10.18.1.25 #define PIN_RIGHT_BUTTON A1

Definition at line 50 of file core.h.

10.18.1.26 #define PIN_SPEAKER_1 5

Definition at line 64 of file core.h.


Referenced by Arduboy::begin(), and Arduboy::beginNoLogo().

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


60 File Documentation

10.18.1.27 #define PIN_SPEAKER_1_BITMASK _BV(6)

Definition at line 70 of file core.h.

10.18.1.28 #define PIN_SPEAKER_1_PORT &PORTC

Definition at line 67 of file core.h.

10.18.1.29 #define PIN_SPEAKER_2 13

Definition at line 65 of file core.h.


Referenced by Arduboy::begin(), and Arduboy::beginNoLogo().

10.18.1.30 #define PIN_SPEAKER_2_BITMASK _BV(7)

Definition at line 71 of file core.h.

10.18.1.31 #define PIN_SPEAKER_2_PORT &PORTC

Definition at line 68 of file core.h.

10.18.1.32 #define PIN_UP_BUTTON A0

Definition at line 51 of file core.h.

10.18.1.33 #define RED_LED 10

Definition at line 42 of file core.h.


Referenced by ArduboyCore::setRGBled().

10.18.1.34 #define RIGHT_BUTTON _BV(6)

Definition at line 58 of file core.h.


Referenced by enterInitials(), loop(), and movePaddle().

10.18.1.35 #define RST 6

Definition at line 40 of file core.h.


Referenced by ArduboyCore::bootPins().

10.18.1.36 #define RX_LED 17

Definition at line 46 of file core.h.

10.18.1.37 #define TX_LED 30

Definition at line 45 of file core.h.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


10.19 Arduboy/src/glcdfont.c File Reference 61

10.18.1.38 #define UP_BUTTON _BV(7)

Definition at line 59 of file core.h.


Referenced by ArduboyCore::boot(), Arduboy::bootUtils(), enterInitials(), and loop().

10.18.1.39 #define WHITE 1

Definition at line 133 of file core.h.


Referenced by Arduboy::bootLogo(), and Arduboy::drawBitmap().

10.18.1.40 #define WIDTH 128

Definition at line 129 of file core.h.


Referenced by ArduboyCore::blank(), Arduboy::drawBitmap(), Arduboy::drawChar(), Arduboy::drawFastHLine(),
Arduboy::drawPixel(), Arduboy::drawSlowXYBitmap(), Arduboy::getPixel(), moveBall(), movePaddle(), Arduboy←-
Core::paintScreen(), setup(), ArduboyCore::width(), and Arduboy::write().

10.19 Arduboy/src/glcdfont.c File Reference

#include <avr/io.h>
#include <avr/pgmspace.h>
Include dependency graph for glcdfont.c: This graph shows which files directly or indirectly include this file:

Macros

• #define FONT5X7_H

Variables

• static const unsigned char font[ ] PROGMEM

10.19.1 Macro Definition Documentation

10.19.1.1 #define FONT5X7_H

Definition at line 5 of file glcdfont.c.

10.19.2 Variable Documentation

10.19.2.1 const unsigned char font [ ] PROGMEM [static]

Definition at line 8 of file glcdfont.c.

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen


62 File Documentation

Generated on Wed Jun 15 2016 08:04:13 for Arduboy Library by Doxygen