I installed Arduino Uno with paj7620u2 as shown in the picture.
I tested with the following code and the result is initialization failed.
#include "RevEng_PAJ7620.h"
RevEng_PAJ7620 sensor = RevEng_PAJ7620();
void setup() {
Serial.begin(9600);
if (!sensor.begin()) {
Serial.print("PAJ7620U2 initialization failed");
}
}
void loop() {
Gesture gesture = sensor.readGesture();
switch (gesture) {
case GES_FORWARD:
Serial.println("FORWARD");
break;
case GES_BACKWARD:
Serial.println("BACKWARD");
break;
case GES_LEFT:
Serial.println("LEFT");
break;
case GES_RIGHT:
Serial.println("RIGHT");
break;
case GES_UP:
Serial.println("UP");
break;
case GES_DOWN:
Serial.println("DOWN");
break;
case GES_CLOCKWISE:
Serial.println("CLOCKWISE");
break;
case GES_ANTICLOCKWISE:
Serial.println("ANTICLOCKWISE");
break;
case GES_WAVE:
Serial.println("WAVE");
break;
}
}
I would like to check if my I2C is working properly, I tested an SSD1306 OLED Screen and the result is that it can display pictures and text properly.
#include <Wire.h>
void setup() {
Serial.begin(9600);
Wire.begin();
Serial.println("I2C Scanner...");
for (byte address = 1; address < 127; address++) {
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0) {
Serial.print("I2C device found at address 0x");
Serial.println(address, HEX);
}
}
}
void loop() {
// put your main code here, to run repeatedly:
}
I’ve tried three brand new paj7620u2’s and none of them are detected, I’m wondering if I’m making some kind of mistake and not finding them.
3