Compare commits
2 Commits
96295c6d50
...
f498e9b0cc
Author | SHA1 | Date | |
---|---|---|---|
|
f498e9b0cc | ||
|
d133eb9dd9 |
26
main.c
26
main.c
@ -158,7 +158,7 @@ void decreaseDutyCycle() {
|
||||
void checkButton(uint8_t pin, const char* message, void (*command)()) {
|
||||
if (bit_is_clear(PINC, pin)) {
|
||||
Serial.println(message);
|
||||
delay(1000);
|
||||
delay(200);
|
||||
command();
|
||||
}
|
||||
}
|
||||
@ -230,3 +230,27 @@ void sendCommand(uint8_t cmd, float value) {
|
||||
|
||||
|
||||
|
||||
|
||||
// void sendCommand(uint8_t cmd, float value) {
|
||||
// uint16_t cmd_value = ((uint16_t)cmd << 8) | (uint16_t)(value * 16);
|
||||
// uint8_t upper_byte = cmd_value >> 8;
|
||||
// uint8_t lower_byte = cmd_value & 0xFF;
|
||||
|
||||
// i2c_start();
|
||||
// i2c_write(PWM_SLAVE_ADDR << 1);
|
||||
// i2c_write(cmd);
|
||||
// i2c_write(upper_byte);
|
||||
// i2c_write(lower_byte);
|
||||
// i2c_stop();
|
||||
|
||||
// Serial.print("Sent command: 0x");
|
||||
// Serial.print(cmd, HEX);
|
||||
// Serial.print(", value: ");
|
||||
// Serial.print(cmd_value / 16);
|
||||
// Serial.print(", cmd value: ");
|
||||
// Serial.print(cmd_value);
|
||||
// Serial.print(", data bytes: 0x");
|
||||
// Serial.print(upper_byte, HEX);
|
||||
// Serial.print(" ");
|
||||
// Serial.println(lower_byte, HEX);
|
||||
// }
|
Loading…
Reference in New Issue
Block a user