Skip to content

MPU6050#35

Open
oliveiraallex wants to merge 4 commits into
pharo-iot:devfrom
oliveiraallex:MPU6050
Open

MPU6050#35
oliveiraallex wants to merge 4 commits into
pharo-iot:devfrom
oliveiraallex:MPU6050

Conversation

@oliveiraallex

Copy link
Copy Markdown
Member

Driver to sensor MPU6050 accelerometer/gyroscope

@dionisiydk dionisiydk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@dionisiydk

Copy link
Copy Markdown
Collaborator

I have one idea to change package structure.
Would be nice to add meaningful parts to package names. Instead of very raw letters and numbers like:

  • 'PharoThings-Devices-MCP9808'
  • 'PharoThings-Devices-BME280'
  • 'PharoThings-Devices-HD44780'

To have something like:

  • 'PharoThings-Devices-TemperatureSensors-MCP9808'
  • 'PharoThings-Devices-TemperatureSensors-BME280'
  • 'PharoThings-Devices-LCDs-HD44780'

(names are from my bad memory and can be wrong:))
(and maybe WeatherSensors are better than Temperature)

@oliveiraallex

oliveiraallex commented Aug 7, 2019

Copy link
Copy Markdown
Member Author

Nice idea! Now the number of sensors is growing up, we need to organize them.

What do you think to put these classes inside a package? They are in most cases, 1 class in 1 package. Maybe could be:

  • 'PharoThings-Devices-WeatherSensors'
    • 'PotMCP9808Device'
    • 'PotBME280Device'
  • 'PharoThings-Devices-LCD'
    • 'PotLCDHD44780'
      • PotLCDHD44780Gpio
        • PotLCD1602Device
      • PotLCDHD44780I2C
        • PotLCD1602DeviceI2C
  • 'PharoThings-Devices-SpaceSensors'
    • 'PotADXL345Device'
    • 'PotHCSR04Device'
    • 'PotMPU6050Device'

@dionisiydk

dionisiydk commented Aug 7, 2019 via email

Copy link
Copy Markdown
Collaborator

| h l value |
h := i2cConnection read8BitsAt: anHex.
l := i2cConnection read8BitsAt: anHex + 1.
(h == 0 & l == 0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have more meaningful names for h and l it would be much better.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to improve it. I rewrote this drive from scratch, I'm just finishing some adjusts to push it again.

@oliveiraallex

Copy link
Copy Markdown
Member Author

@dionisiydk do you think we can change the name pattern of devices class to start with the word PotDevicexxx instead of PotxxxDevice? Sometimes I forget the name of the sensor and should be better they be shown in the autocompletion when type PotDevice:

image

if it's ok, I'm going to open a new PR to this and to organize the packages, as we talk before.

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

Successfully merging this pull request may close these issues.

2 participants