![](/2022/pdf/222/318/bg4.jpg)
Revision:A
ReleaseLevel:ACTIVE
Sheet4of5
©2011KnowlesElectronics
KJ‐33000‐002
charXspeed[16]={0,15,31,47,63,79,95,111,0,‐15,‐31,‐47,‐63,‐79,‐95,‐111};
linearlyexpandsthevalueoutputbythejoystickbyindexingtheJoystickXvalueinthe
array.
LookupXSpeed=Xspeed[JoystickX];
3.3. LowPowerModes
Therearetwolowpowermodestothejoystick;lowpowerandsleepmode.Toputthe
joystickintolowpowermode,asimplewritetothejoystickwiththeleastsignificantbit
beingaoneisrequired.Toputthejoystickintosleepmode,theleastsignificantbitof
thewritemustbeazero.
Sample:
IdleI2C();//WaitforanIdleCondition
StartI2C();//IssueaStartCondition
IdleI2C();//WaitforanIdleCondition
address=0x38<<1|0x00;//JoystickAddressPlusWrite
ack=WriteI2C(address);//Writetheaddressplusread
IdleI2C();//
WaitforanIdleCondition
ack=WriteI2C(0);//PutthejoystickintoLowPwr
NotAckI2C();//IssuetheNo‐AckCondition
IdleI2C();//WaitforanIdleCondition
StopI2C();//ReleasetheBus
ThisexamplewillputtheJoystickintosleepmode.Thecurrentconsumptionofthe
devicewillbeatitsminimuminthismode.