diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-05 12:51:24 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-05 12:51:24 +0200 |
commit | a8b794c02574e96150d55852fa5db1ce7529503d (patch) | |
tree | cac16715745c58aa18b3c8fac8f058517ef234a9 /puzzle/dummy/main.cpp | |
parent | a96ffb4d0fd8576d753bb975b674b2aeef617d5f (diff) |
add arduino cmake toolchain + improve lazy.mk
Diffstat (limited to 'puzzle/dummy/main.cpp')
-rw-r--r-- | puzzle/dummy/main.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/puzzle/dummy/main.cpp b/puzzle/dummy/main.cpp new file mode 100644 index 0000000..4374066 --- /dev/null +++ b/puzzle/dummy/main.cpp @@ -0,0 +1,23 @@ +#include <Arduino.h> +#include <Wire.h> + +void receiveEvent(int howMany){ + while (Wire.available()){ + char c = Wire.read(); + Serial.print(c, HEX); + } + Serial.println(); +} + +void setup() { + Wire.begin(0x00); + Wire.onReceive(receiveEvent); +} + +void loop() { + const uint8_t data[] = {0xff, 0x00, 0xde, 0xad, 0xbe, 0xef}; + Wire.beginTransmission(0x69); + Wire.write(data, sizeof(data)); + Wire.endTransmission(); +} + |