{"id":23744943,"url":"https://github.com/stm32duino/ism330dhcx","last_synced_at":"2025-09-04T19:32:16.913Z","repository":{"id":43836450,"uuid":"300205393","full_name":"stm32duino/ISM330DHCX","owner":"stm32duino","description":"Arduino library to support the ISM330DHCX 3D accelerometer and 3D gyroscope","archived":false,"fork":false,"pushed_at":"2022-11-23T16:42:50.000Z","size":154,"stargazers_count":5,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2023-02-26T16:01:13.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stm32duino.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T08:31:05.000Z","updated_at":"2022-02-16T17:04:16.000Z","dependencies_parsed_at":"2022-09-21T03:13:16.286Z","dependency_job_id":null,"html_url":"https://github.com/stm32duino/ISM330DHCX","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stm32duino%2FISM330DHCX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stm32duino%2FISM330DHCX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stm32duino%2FISM330DHCX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stm32duino%2FISM330DHCX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stm32duino","download_url":"https://codeload.github.com/stm32duino/ISM330DHCX/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231987772,"owners_count":18456475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-31T12:51:04.202Z","updated_at":"2024-12-31T12:51:05.142Z","avatar_url":"https://github.com/stm32duino.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ISM330DHCX\nArduino library to support the ISM330DHCX 3D accelerometer and 3D gyroscope\n\n## API\n\nThis sensor uses I2C or SPI to communicate.\nFor I2C it is then required to create a TwoWire interface before accessing to the sensors:  \n\n    TwoWire dev_i2c(I2C_SDA, I2C_SCL);  \n    dev_i2c.begin();\n\nFor SPI it is then required to create a SPI interface before accessing to the sensors:  \n\n    SPIClass dev_spi(SPI_MOSI, SPI_MISO, SPI_SCK);  \n    dev_spi.begin();\n\nAn instance can be created and enabled when the I2C bus is used following the procedure below:  \n\n    ISM330DHCXSensor AccGyr(\u0026dev_i2c);\n    AccGyr.begin();\n    AccGyr.ACC_Enable();  \n    AccGyr.GYRO_Enable();\n\nAn instance can be created and enabled when the SPI bus is used following the procedure below:  \n\n    ISM330DHCXSensor AccGyr(\u0026dev_spi, CS_PIN);\n    AccGyr.begin();\t\n    AccGyr.ACC_Enable();  \n    AccGyr.GYRO_Enable();\n\nThe access to the sensor value is done as explained below:\n\n  Read accelerometer and gyroscope.\n\n    int32_t accelerometer[3];\n    int32_t gyroscope[3];\n    AccGyr.ACC_GetAxes(accelerometer);  \n    AccGyr.GYRO_GetAxes(gyroscope);\n\n## Units\n\nAll the MEMS drivers in stm32duino repositories have the same units when returning physical (scaled) values:\n\n    - mg for accelerometer (thousandth of g, 1g is 9.81 m/s^2)\n    - mdps for gyroscope (thousandth of degree/s)\n    - mgauss for magnetometer (thousandth of gauss)\n\nReadings can be obtained either as raw (unscaled) ```uint16_t``` values from the ```XXX_GetAxesRaw``` functions, or as physical (scaled) ```uint32_t``` values from the ```XXX_GetAxes``` functions, where ```XXX``` is either ```ACC``` or ```GYRO```. The factor to use for scaling from a raw to a physical value is obtained from the ```XXX_GetSensitivity``` functions.\n\nFor example, to convert the raw acceleration reading to float m/s^2, the following can be done:\n\n```cpp\nint16_t acc_raw[3];\nfloat acc_ms2[3];\nfloat acc_sensitivity;\n\nAccGyr.ACC_GetAxesRaw(acc_raw);\nAccGyr.ACC_GetSensitivity(\u0026acc_sensitivity);\n\nacc_ms2[0] = ((float)acc_raw[0] * acc_sensitivity) / 1000.0f * 9.81f;\nacc_ms2[1] = ((float)acc_raw[1] * acc_sensitivity) / 1000.0f * 9.81f;\nacc_ms2[2] = ((float)acc_raw[2] * acc_sensitivity) / 1000.0f * 9.81f;\n```\n\n## Documentation \nYou can find the source files at  \nhttps://github.com/stm32duino/ISM330DHCX\n\nThe ISM330DHCX datasheet is available at  \nhttps://www.st.com/en/mems-and-sensors/ism330dhcx.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstm32duino%2Fism330dhcx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstm32duino%2Fism330dhcx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstm32duino%2Fism330dhcx/lists"}