Skip to content

docs: 2144 - ctrehan/2144 #2662

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/java/io/pslab/activity/SensorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
sensorAddr.put(0x77, "BMP180");
sensorAddr.put(0x5A, "MLX90614");
sensorAddr.put(0x1E, "HMC5883L");
sensorAddr.put(0x68, "MPU6050");
sensorAddr.put(0x69, "MPU6050");
sensorAddr.put(0x40, "SHT21");
sensorAddr.put(0x39, "TSL2561");
sensorAddr.put(0x69, "MPU925x");
Comment on lines +81 to 84
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Duplicate key mapping for 0x69 in sensorAddr may lead to unintended overrides.

Both MPU6050 and MPU925x are mapped to the same I2C address key (0x69), which means the latter mapping will overwrite the earlier one. It’s important to verify whether these devices should share the same address or if a distinct address or strategy (such as separate maps or composite values) is required.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)
sensorAddress.put(0x77, "BMP180");
sensorAddress.put(0x5A, "MLX90614");
sensorAddress.put(0x1E, "HMC5883L");
sensorAddress.put(0x68, "MPU6050");
sensorAddress.put(0x69, "MPU6050");
sensorAddress.put(0x40, "SHT21");
sensorAddress.put(0x39, "TSL2561");
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/io/pslab/communication/SensorList.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public SensorList() {
sensorList.put(0x5A, new String[]{"MLX90614 PIR temperature"});
sensorList.put(0x1E, new String[]{"HMC5883L magnetometer", "LSM303 magnetometer"});
sensorList.put(0x77, new String[]{"BMP180/GY-68 altimeter", "MS5607", "MS5611"});
sensorList.put(0x68, new String[]{"MPU-6050/GY-521 accel+gyro+temp", "ITG3200", "DS1307", "DS3231"});
sensorList.put(0x69, new String[]{"MPU-6050/GY-521 accel+gyro+temp", "ITG3200", "DS1307", "DS3231"});
sensorList.put(0x69, new String[]{"ITG3200"});
Comment on lines +28 to 29
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Conflicting entries for key 0x69 in sensorList could result in inadvertent data loss.

The first mapping for 0x69 (associating multiple sensor names including MPU-6050) is being overwritten by the second mapping (only "ITG3200") because map keys must be unique. Please double-check the intended sensor addressing to ensure both sets of sensor identifications are preserved or differentiated.

sensorList.put(0x76, new String[]{"MS5607", "MS5611"});
sensorList.put(0x6B, new String[]{"LSM9DSO gyro"});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class MPU6050 {
private int GR = 3;
private int NUMPLOTS = 7;
public String[] PLOTNAMES = {"Ax", "Ay", "Az,'Temp", "Gx", "Gy", "Gz"};
private int ADDRESS = 0x68;
private int ADDRESS = 0x69;
private String name = "Accel/gyro";
private ArrayList<KalmanFilter> K = new ArrayList<>(); //K is the list of KalmanFilter object
private I2C i2c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MPU925x {
private int GR = 3;
private int NUMPLOTS = 7;
public String[] PLOTNAMES = new String[]{"Ax", "Ay", "Az", "Temp", "Gx", "Gy", "Gz"};
private int ADDRESS = 0x68;
private int ADDRESS = 0x69;
private int AK8963_ADDRESS = 0x0C;
private int AK8963_CNTL = 0x0A;
public String name = "Accel/gyro";
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="nav_device">توصيل الجهاز</string>
<string name="nav_instruments">الادوات</string>
<string name="nav_settings">الإعدادات</string>
<string name="nav_documentation">التوثيق</string>
<string name="nav_about_us">معلومات عنا</string>
<string name="nav_buy_pslab">شراء PSLab</string>
<string name="nav_report">ردود الفعل</string>
Expand Down Expand Up @@ -284,6 +285,18 @@
<string name="gx">GX</string>
<string name="gy">Gy</string>
<string name="gz">Gz</string>
<string name="red">أحمر</string>
<string name="green">أخضر</string>
<string name="blue">أزرق</string>
<string name="clear">مسح</string>
<string name="gesture">إيماءة</string>
<string name="eCO2">ثاني أكسيد الكربون المكافئ</string>
<string name="eTVOC">المركبات العضوية المتطايرة الكلية</string>
<string name="plot_lux">مخطط - ضوء لوكس</string>
<string name="plot_proximity">مخطط - القرب</string>
<string name="proximity">القرب</string>
<string name="lux_unit">لوكس</string>
<string name="light_lux">لوكس</string>
<string name="temp">مؤقت</string>
<string name="luminosity">لمعان</string>
<string name="humidity">رطوبة</string>
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="nav_device">Połącz urządzenie</string>
<string name="nav_instruments">Narzędzia</string>
<string name="nav_settings">Ustawienia</string>
<string name="nav_documentation">Dokumentacja</string>
<string name="nav_about_us">O nas </string>
<string name="nav_buy_pslab">Kup PSLab</string>
<string name="nav_report">Opinie &amp; Błędy</string>
Expand Down Expand Up @@ -287,6 +288,18 @@
<string name="gx">Gx</string>
<string name="gy">Gy</string>
<string name="gz">Gz</string>
<string name="red">Czerwony</string>
<string name="green">Zielony</string>
<string name="blue">Niebieski</string>
<string name="clear">Wyczyść</string>
<string name="gesture">Gest</string>
<string name="eCO2">eCO2</string>
<string name="eTVOC">TVOC</string>
<string name="plot_lux">Wykres - Natężenie światła</string>
<string name="plot_proximity">Wykres - Bliskość</string>
<string name="proximity">Bliskość</string>
<string name="lux_unit">lx</string>
<string name="light_lux">Luks</string>
<string name="temp">Temp</string>
<string name="luminosity">Luminancja</string>
<string name="humidity">Wilgotność</string>
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="nav_device">Подключение устройства</string>
<string name="nav_instruments">Инструменты</string>
<string name="nav_settings">Settings</string>
<string name="nav_documentation">Документация</string>
<string name="nav_about_us">О нас</string>
<string name="nav_buy_pslab">Купить PSLab</string>
<string name="nav_report">Обратная связь</string>
Expand Down Expand Up @@ -288,6 +289,18 @@
<string name="gx">Gx</string>
<string name="gy">Gy</string>
<string name="gz">Gz</string>
<string name="red">Красный</string>
<string name="green">Зелёный</string>
<string name="blue">Синий</string>
<string name="clear">Очистить</string>
<string name="gesture">Жест</string>
<string name="eCO2">eCO2</string>
<string name="eTVOC">TVOC</string>
<string name="plot_lux">График - Освещённость (Lux)</string>
<string name="plot_proximity">График - Близость</string>
<string name="proximity">Близость</string>
<string name="lux_unit">lx</string>
<string name="light_lux">Люкс</string>
<string name="temp">Температуры</string>
<string name="luminosity">Светимость</string>
<string name="humidity">Влажность</string>
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/values-si/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<string name="nav_device">උපාංගය සම්බන්ධ කරන්න</string>
<string name="nav_instruments">උපකරණ</string>
<string name="nav_settings">සැකසුම්</string>
<string name="nav_documentation">ලේඛන ගබඩාව</string>
<string name="nav_about_us">අප ගැන</string>
<string name="nav_buy_pslab">PSLab මිලදී ගන්න</string>
<string name="nav_report">දෝෂ හා ප්‍රතිචාර</string>
Expand Down Expand Up @@ -288,6 +289,18 @@
<string name="gx">Gx</string>
<string name="gy">Gy</string>
<string name="gz">Gz</string>
<string name="red">රතු</string>
<string name="green">කොළ</string>
<string name="blue">නීල</string>
<string name="clear">මකන්න</string>
<string name="gesture">ඉඟිය</string>
<string name="eCO2">eCO2</string>
<string name="eTVOC">TVOC</string>
<string name="plot_lux">ප්ලොට් - ආලෝක ලක්ෂ</string>
<string name="plot_proximity">ප්ලොට් - සමීපත්වය</string>
<string name="proximity">සමීපත්වය</string>
<string name="lux_unit">lx</string>
<string name="light_lux">ලක්ස්</string>
<string name="temp">උෂ්ණත්වය</string>
<string name="luminosity">ආලෝක තීව්‍රතාවය</string>
<string name="humidity">ආර්ද්‍රතාවය</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
<string name="plot_lux">Plot - Light Lux</string>
<string name="plot_proximity">Plot - Proximity</string>
<string name="proximity">Prox</string>
<string name="lux_unit">(lx)</string>
<string name="lux_unit">lx</string>
<string name="light_lux">Lux</string>
<string name="temp">Temp</string>
<string name="luminosity">Luminosity</string>
Expand Down
Loading