Closed rimolive closed 9 years ago
@rimolive, thanks for working on issue #69
It's nice to know that GalileoGen2's driver works for Edison. So I guess we don't need duplicated code.
This is how I think we should handle this:
class BaseMraa(...):
def __init__(...):
# code
def other_methods(...):
# code
class Galileo2(BaseMraa):
def __init__(...):
# code
class Edison(BaseMraa):
def __init__(...):
# code
Excellent, @rimolive!
@vido, I agree with your idea of creating an intel package with the classes you named.
The names are also good! (I don't like the mraa name -- how do you pronounce it? -- but that's not our fault).
Given that Intel named the API mraa, BaseMraa is a good name for the class.
On Wed, Feb 18, 2015 at 4:53 PM, Lucas Vido notifications@github.com wrote:
@rimolive https://github.com/rimolive, thanks for working on issue #69 https://github.com/garoa/pingo/issues/69
It's nice to know that GalileoGen2's driver works for Edison. So I guess we don't need duplicated code.
This is how I think we should handle this:
- Move the "galileo" folder to "intel", and "galileo.py" to "mraa.py"
- Rename the "Galileo2" class to "BaseMraa" (or something like it...)
- Subclass "BaseMraa" to create "Galileo2" and "Edison"
- Overwrite "def init", if necessary.
class BaseMraa(...): def init(...):
code
def other_methods(...): # code
class Galileo2(BaseMraa): def init(...):
code
class Edison(BaseMraa): def init(...):
code
— Reply to this email directly or view it on GitHub https://github.com/garoa/pingo/pull/71#issuecomment-74923523.
Luciano Ramalho Twitter: @ramalhoorg
Professor em: http://python.pro.br Twitter: @pythonprobr
Why not just use classes Galileo and Edison? After all the only significant differences would be, in Galileo's case, the difference between generation 1 and 2 and about Edison the difference would be the type of shield it is using(we have for now Base Shield, Arduino Shield and the Sparkfun Base shield). Please note that the term 'shield' I used in case of Edison is just the base board where Edison is plugged in.
@rimolive, Yes, we will use Galileo and Edison classes. But we should purge duplicated code. Thats why we need a Base class
This shield-like modules are called “Blocks”. And yes, Blocks will be a problem, They will mess the location idea up. Since every manufecture (SparkFun, Intel, etc..) will place pins as they please.
@rimolive this script of pingo.parts lcd is working or something need to be changed?
It's working but it was only tested on a Raspberry Pi 2 with this particular serial-enabled LCD display:
https://www.sparkfun.com/products/9066
But even with the configuration above, I'm having trouble making it work reliably. Apparently some other process is using the TX pin...
How are you trying to use it?
Please, let's move this conversation to the forum: https://groups.google.com/forum/#!forum/pingo-io
Best,
Luciano
On Sun, Jun 7, 2015 at 2:59 PM, Gabriel Almeida de Souza < notifications@github.com> wrote:
@rimolive https://github.com/rimolive this script of pingo.parts lcd is working or something need to be changed?
— Reply to this email directly or view it on GitHub https://github.com/pingo-io/pingo-py/pull/71#issuecomment-109784330.
Luciano Ramalho | Author of Fluent Python (O'Reilly, 2015) | http://shop.oreilly.com/product/0636920032519.do | Professor em: http://python.pro.br | Twitter: @ramalhoorg
Moved #83
I just made a test and I noticed that Edison has a different platform.machine type. I added a new class and changed the detect.MyBoard() class implementation.