Page 2 of 2

Re: RGB and Gesture Sensor - APDS-9960

Posted: Mon Feb 26, 2018 3:33 pm
by gcarver

Re: RGB and Gesture Sensor - APDS-9960

Posted: Tue Feb 27, 2018 10:50 am
by pythoncoder
That's quite an involved driver. Impressive.

One thing that comes to mind is that you could save over 300 bytes of RAM by renaming some constants so that all of them start with an underscore - see Constants.

Re: RGB and Gesture Sensor - APDS-9960

Posted: Tue Feb 27, 2018 9:32 pm
by OutoftheBOTS_
I have ordered a little break out board for the APDS-9960 and was going to write my own driver then this thread has come up.

What licensing is your code??

Re: RGB and Gesture Sensor - APDS-9960

Posted: Wed Feb 28, 2018 5:25 pm
by gcarver
Thanks pythoncoder. I'll make the _ change. I had forgotten about that rule. As for licensing. I'm not going to add MIT license header and just bloat the file. But that's what I'd go with. Oh, and I should also note that the gesture reading code doesn't work very well. I'm not using it at the moment and simply using the proximity data. But eventually I plan to get back to improving it. It's based on the Adafruit arduino library gesture method which I find theoretically better than the Sparkfun arduino library.

Re: RGB and Gesture Sensor - APDS-9960

Posted: Wed Feb 28, 2018 8:36 pm
by OutoftheBOTS_
Thanks gcarver :)

I only want to use it as a distance sensor, it is much smaller than a ultra sonic sensor and it also can read distance in an array of directions :)

Re: Licensing

Posted: Thu Mar 01, 2018 7:48 am
by pythoncoder
gcarver wrote:
Wed Feb 28, 2018 5:25 pm
...I'm not going to add MIT license header and just bloat the file...
IANAL but I've noticed that many developers have a 2-line comment of the form

Code: Select all

# Copyright Guy Carver 2018
# Released under the MIT license
with the full text in LICENSE.md.
I'd be interested to hear from anyone who does have legal knowledge whether this is adequate.

As a retired hobbyist licensing is not a major preoccupation. Except that I don't want a letter from a company lawyer saying "Our clients used your code in their safety critical system and it seems to have killed a few hundred litigious Americans.".

Re: RGB and Gesture Sensor - APDS-9960

Posted: Sat Apr 28, 2018 9:43 am
by dubaleeiro
hello gcarver , thanks a lot for your good work !

could you please give me some tips to adapt the code to the ESP8266 ?

I have changed the "import! line from "import pyb" to "from machine import Pin, I2C", but I am a litte bit consusef on the following part:

def __init__( self, aLoc ) :
'''aLoc I2C pin location is either 1, 'X', 2 or'Y'.'''
self._i2c = pyb.I2C(aLoc, pyb.I2C.MASTER)

as far as I could undestand from the User-Documentarion, on the ESP8266 it is not possible to especify a Bus line, right? Instead, we need to configure the SCL and SDA pins. How should the code look like?

thanks a lot and sorry for such a basic question...