diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-06 11:56:55 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-06 11:56:55 +0200 |
commit | c7aa2916dce4cd3d82ac1be42c433d1ed66db69e (patch) | |
tree | d75f92b092005c9349ecd119367bdd5be197b638 /puzzle/dummy | |
parent | 6f11bf1dd634e39a2f17fc63f156575f3b10358c (diff) |
WIP debugging arduino puzzle module driver
Diffstat (limited to 'puzzle/dummy')
-rw-r--r-- | puzzle/dummy/main.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/puzzle/dummy/main.cpp b/puzzle/dummy/main.cpp index 1c79441..688549f 100644 --- a/puzzle/dummy/main.cpp +++ b/puzzle/dummy/main.cpp @@ -3,12 +3,36 @@ #include "drv/arduino/mod.h" +// #define THOMAS + +#ifdef THOMAS +#define ADDR_RX 0x69 +#define ADDR_TX 0x20 +#define MSG "hoi" +#define MSG_DELAY 10 +#else +#define ADDR_TX 0x69 +#define ADDR_RX 0x20 +#define MSG "dag" +#define MSG_DELAY 9 +#endif + const char * PBDRV_MOD_NAME = "dummy"; -const i2c_addr_t PBDRV_MOD_ADDR = 0x20; +const i2c_addr_t PBDRV_MOD_ADDR = ADDR_RX; void setup() { pbdrv_setup(); + Serial.begin(115200); + pinMode(4, OUTPUT); + digitalWrite(4, LOW); } -void loop() { } +void loop() { + pbdrv_i2c_send(ADDR_TX, (uint8_t *) MSG, 4); + delay(MSG_DELAY); +} + +void pbdrv_i2c_recv(const uint8_t * data, size_t size) { + Serial.println((char *) data); +} |