RGB and Gesture Sensor - APDS-9960
Re: RGB and Gesture Sensor - APDS-9960
End of line...
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: RGB and Gesture Sensor - APDS-9960
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.
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.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: RGB and Gesture Sensor - APDS-9960
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??
What licensing is your code??
Re: RGB and Gesture Sensor - APDS-9960
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.
End of line...
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: RGB and Gesture Sensor - APDS-9960
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
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
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Licensing
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
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.".
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 7
- Joined: Mon Feb 12, 2018 9:52 pm
Re: RGB and Gesture Sensor - APDS-9960
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...
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...