Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Arduino Examples/PMW3389DM-polling/PMW3389DM-polling.ino
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ void UpdatePointer(void){
adns_write_reg(Motion, 0x01);
adns_read_reg(Motion);

xydat[0] = (int)adns_read_reg(Delta_X_L);
xydat[1] = (int)adns_read_reg(Delta_Y_L);
xydat[0] = (int)adns_read_reg(Delta_X_L) | (int)adns_read_reg(Delta_X_H) << 8;
xydat[1] = (int)adns_read_reg(Delta_Y_L) | (int)adns_read_reg(Delta_Y_H) << 8;

movementflag=1;
}
Expand Down Expand Up @@ -237,8 +237,8 @@ void dispRegisters(void){

int convTwosComp(int b){
//Convert from 2's complement
if(b & 0x80){
b = -1 * ((b ^ 0xff) + 1);
if(b & 0x8000){
b = -1 * ((b ^ 0xffff) + 1);
}
return b;
}
Expand Down