Skip to content

Commit

Permalink
add support for ESP-IDF component registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Fischer committed Jan 16, 2025
1 parent f301f03 commit 4971b5b
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Xiaomi CyberGear Driver

[![Component Registry](https://components.espressif.com/components/cybergear-robotics/cybergear/badge.svg)](https://components.espressif.com/components/cybergear-robotics/cybergear)
[![Examples build](https://github.com/cybergear-robotics/cybergear/actions/workflows/build_example.yml/badge.svg)](https://github.com/cybergear-robotics/cybergear/actions/workflows/build_example.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity)
[![Framework](https://img.shields.io/badge/Framework-ESP_IDF-orange.svg)](https://shields.io/)
[![Language](https://img.shields.io/badge/Language-C-purple.svg)](https://shields.io/)


This driver uses Espressif's TWAI (Two-Wire Automotive Interface) in
order to communicate with Xiamoi CyberGear motors. It bases on the library
[Xiaomi_CyberGear_Arduino](https://github.com/DanielKalicki/Xiaomi_CyberGear_Arduino)
This driver uses Espressif's TWAI (Two-Wire Automotive Interface) in
order to communicate with Xiamoi CyberGear motors. It bases on the library
[Xiaomi_CyberGear_Arduino](https://github.com/DanielKalicki/Xiaomi_CyberGear_Arduino)
and is ported for ESP-IDF.

# Safety
## Safety

This library does not use error logs/prints, but instead every internal error is
This library does not use error logs/prints, but instead every internal error is
passed through. Therefore each relevant function returns `esp_err_t`, which should
be handled. During development `ESP_ERROR_CHECK(...)` helps, but due to the strength
of these motors, an error should be resolved or the motors should be stopped by an
of these motors, an error should be resolved or the motors should be stopped by an
external emergency mechanism.

Pay attention: The motor provides a list of faults. These are not tested yet and the code is beta.
Expand All @@ -35,20 +36,27 @@ Following lists the faults and whether a fault was already correctly tested:
* [ ] `magnetic_code_failure`
* [ ] `hall_coded_faults`

## Using component
```bash
idf.py add-dependency "cybergear-robotics/cybergear"
```

# Example
## Example

1. Clone Repository
2. Go to the example directory
`cd ./cybergear/examples/position_test`
1. create example project
```bash
idf.py create-project-from-example "cybergear-robotics/cybergear:position_test"
```
2. Go to to example directory (for example `position_test`)
`cd position_test`
3. Set ESP chip
`idf.py set-target esp32`
4. Configure CAN TX/RX in menu `CyberGear Example`.
`idf.py menuconfig`
5. Build, flash
`idf.py build flash monitor`

# Related projects
## Related projects

* [Xiaomi_CyberGear_Arduino](https://github.com/DanielKalicki/Xiaomi_CyberGear_Arduino)
* [Xiaomi_CyberGear_Arduino](https://github.com/DanielKalicki/Xiaomi_CyberGear_Arduino)
* [cybergear_m5](https://github.com/project-sternbergia/cybergear_m5)

0 comments on commit 4971b5b

Please sign in to comment.