/*
MicroOLEDShieldExample.ino
SparkFunMicroOLEDLibraryHelloWorldExample
JimLindblom@SparkFunElectronics
OriginalCreationDate:June22,2015
Thissketchprintsafriendly,recognizablelogoontheOLEDS
hield,then
goesontodemotheMicroOLEDlibrary'sfunctionalitydrawi
ngpixels,
lines,shapes,andtext.
Har
dwareConnections:
ThissketchwaswrittenspecificallyforthePhotonMicroOL
EDShield,whichdoesallthewiringforyou.IfyouhaveaMi
croOLEDbreakout,usethefollowinghardwaresetup:
MicroOLEDPhoton
GNDGND
VDD3.3V(VCC)
D1/MOSIA5(don'tchange)
D0/SCKA3(don'tchange)
D2
D/CD6(canbeanydigitalpin)
RSTD7(canbeanydigitalpin)
CSA2(canbeanydigitalpin)
Developmentenvironmentspecifics:
IDE:ParticleBuild
HardwarePlatform:ParticlePhoton
SparkFunPhotonMicroOLEDShield
Thiscodeisbeerware;ifyouseeme(oranyotherSpar
kFun
employee)atthelocal,andyou'vefoundourcodehelpful,
pleasebuyusaround!
Distributedasis;nowarrantyisgiven.
*/
//////////////////////////////////
//MicroOLEDObjectDeclaration//
//////////////////////////////////
//DeclareaMicroOLEDobject.Ifnoparametersaresupplied,
defaultpinsare
//used,whichwillworkforth
ePhotonMicroOLEDShield(RST
=D7,DC=D6,CS=A2)
MicroOLEDoled;
void setup()
{
oled.begin();//InitializetheOLED
oled.clear(ALL);//Clearthedisplay'sinternalmemory
oled.display();//Displaywhat'sinthebuffer(splashscre
en)
delay(1000);//Delay1000ms
oled.clear(PAGE);//Clearthebuffer.
randomSeed(analogRead(A0)+ analogRead(A1));
}
void loop()
{
pixelExample();//Runthep
ixelexamplefunction
Page 6 of 1