mirror of
https://github.com/esphome/esphome.git
synced 2025-02-21 02:32:26 +01:00
Update esphome/components/ld2450/ld2450.h
Fixes target direction always being moving away Co-authored-by: Trevor Schirmer <24777085+TrevorSchirmer@users.noreply.github.com>
This commit is contained in:
parent
d78fdf1790
commit
18c9ebfed0
@ -215,6 +215,8 @@ class LD2450Component : public Component, public uart::UARTDevice {
|
||||
}
|
||||
int16_t decode_speed_(uint8_t low_byte, uint8_t high_byte) {
|
||||
int16_t speed = (high_byte & 0x7F) << 8 | low_byte;
|
||||
if ((high_byte & 0x80) == 0)
|
||||
speed = -speed;
|
||||
return speed * 10; // mm/s
|
||||
}
|
||||
std::string convert_signed_int_to_hex_(int value) {
|
||||
|
Loading…
Reference in New Issue
Block a user