Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apds9960 gesture sensor block #138

Closed
linsThankachan opened this issue Dec 2, 2021 · 28 comments
Closed

apds9960 gesture sensor block #138

linsThankachan opened this issue Dec 2, 2021 · 28 comments

Comments

@linsThankachan
Copy link

the block for apds9960 gesture sensor is not working. there is "gesture enable" block which is not enabling the gesture but disabling it
and also there is problem for color detection also same problem

Screenshot from 2021-12-02 15-22-22

for gesture to work there should be a proximity enable also
Screenshot from 2021-12-02 15-26-34
.

@cparrapa
Copy link
Member

cparrapa commented Dec 5, 2021

Great Find @linsThankachan what sensor do you use?
I constantly find issues with this sensors even on the hardware part

@linsThankachan
Copy link
Author

it is a generic apds9960 sensor. you can see that whenever we do enable. the code side will be disabled.

@linsThankachan
Copy link
Author

hello, i have checked with sparkfun apds library it is not working but adafruit apds9960 library it is working. ottoblockly uses sparkfun's library

@cparrapa
Copy link
Member

cparrapa commented Dec 6, 2021

Great Find thanks! @linsThankachan we will make sure to do this update for next release.
Any other issue you have seen?

@linsThankachan
Copy link
Author

the ir reciver code for remote also not working.

@linsThankachan
Copy link
Author

when will be the next release because we are using ottoblockly for our products.

@logix5
Copy link
Contributor

logix5 commented Dec 8, 2021 via email

@linsThankachan
Copy link
Author

linsThankachan commented Dec 8, 2021

image
the above is code in ottoblockly . it is not working.

i have given below the working code using arduino ide and using adafruit apds library. i have checked and sparkfun's apds library is not working. given below is the example code for gesture sensing.
``
/***************************************************************************
This is a library for the APDS9960 digital proximity, ambient light, RGB, and gesture sensor

This sketch puts the sensor in gesture mode and decodes gestures.
To use this, first put your hand close to the sensor to enable gesture mode.
Then move your hand about 6" from the sensor in the up -> down, down -> up,
left -> right, or right -> left direction.

Designed specifically to work with the Adafruit APDS9960 breakout
----> http://www.adafruit.com/products/3595

These sensors use I2C to communicate. The device's I2C address is 0x39

Adafruit invests time and resources providing this open source code,
please support Adafruit andopen-source hardware by purchasing products
from Adafruit!

Written by Dean Miller for Adafruit Industries.
BSD license, all text above must be included in any redistribution
***************************************************************************/

#include "Adafruit_APDS9960.h"
Adafruit_APDS9960 apds;

// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(115200);

if(!apds.begin()){
Serial.println("failed to initialize device! Please check your wiring.");
}
else Serial.println("Device initialized!");

//gesture mode will be entered once proximity mode senses something close
apds.enableProximity(true);
apds.enableGesture(true);
}

// the loop function runs over and over again forever
void loop() {
//read a gesture from the device
uint8_t gesture = apds.readGesture();
if(gesture == APDS9960_DOWN) Serial.println("v");
if(gesture == APDS9960_UP) Serial.println("^");
if(gesture == APDS9960_LEFT) Serial.println("<");
if(gesture == APDS9960_RIGHT) Serial.println(">");
}
``

@logix5
Copy link
Contributor

logix5 commented Dec 8, 2021 via email

@linsThankachan
Copy link
Author

can you give that code so that i can test it.
In ottoblockly also there is no interrupt correct.

@cparrapa
Copy link
Member

cparrapa commented Dec 9, 2021

the ir receiver code for remote also not working.

Hi @linsThankachan

This we can move to this issue #128
What IR receiver are you using?
What remote control and microcontroller board are you using?

@logix5
Copy link
Contributor

logix5 commented Dec 9, 2021 via email

@linsThankachan
Copy link
Author

@logix5 cannot see your image

@logix5
Copy link
Contributor

logix5 commented Dec 10, 2021 via email

@linsThankachan
Copy link
Author

cannot see it. it is showing only text

@linsThankachan
Copy link
Author

Screenshot from 2021-12-10 17-18-16

@logix5
Copy link
Contributor

logix5 commented Dec 10, 2021 via email

@linsThankachan
Copy link
Author

image
the above is the block code im uploaded. it is the same as you have given. but it is not working. I have checked in arduino ide also with same sparfun library but it is not working. but when i use adafruit apds9960 library it is working.

@logix5
Copy link
Contributor

logix5 commented Dec 10, 2021 via email

@linsThankachan
Copy link
Author

I have already tested the sensor with sparkfun library which i have installed 5 or 6 days before which means it is updated, for your consideration i have checked one more time also there is was no updates.

ottoblockly doesn't have an interrupt in the code side but sparkfun's example has it . so first i tried with no interrupt there was no result. then i have connected with an interrupt pin that the example pointed then also no output.

The sensor has no problem because it is working perfectly with adafruit apds9960 library which i used and got the output .

please check if your library is updated.
please download adafruit library and test that also if that is working we can change to adafruit library.

i'am using an arduino uno

i don't know how you are getting the output from blockly because the boolean that enables the gesture sensor is false when we give true in blocks.

@logix5
Copy link
Contributor

logix5 commented Dec 10, 2021 via email

@linsThankachan
Copy link
Author

linsThankachan commented Dec 10, 2021 via email

@logix5
Copy link
Contributor

logix5 commented Dec 10, 2021 via email

@linsThankachan
Copy link
Author

ok thanks

@linsThankachan
Copy link
Author

hello i want to ask one thing which is not related to this one.
is otto scratch ai opensource?

@logix5
Copy link
Contributor

logix5 commented Dec 11, 2021 via email

@logix5
Copy link
Contributor

logix5 commented Dec 11, 2021 via email

@linsThankachan
Copy link
Author

hi ,
i have tested it . it is working in the online editor.
thanks you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants