[WIP] Placeholder .cpp
This commit is contained in:
parent
1088640e91
commit
ae75a96c40
18
esphome/components/kp182/kp18x.cpp
Normal file
18
esphome/components/kp182/kp18x.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
namespace esphome {
|
||||
namespace kp18x {
|
||||
|
||||
class kp18x: public serial_port
|
||||
|
||||
public void write_register(register register, uint value)
|
||||
{
|
||||
byte[] message = new byte[11 + 2];
|
||||
message[6] = sizeof(uint); //4
|
||||
message[7] = (byte)(value >> 24);
|
||||
message[8] = (byte)(value >> 16);
|
||||
message[9] = (byte)(value >> 8);
|
||||
message[10] = (byte)(value >> 0);
|
||||
send_message(command.write_single, (ushort)register, 1, ref message);
|
||||
delay();
|
||||
get_response(9);
|
||||
}
|
Loading…
Reference in New Issue
Block a user