diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-26 17:41:14 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-26 17:41:14 +0200 |
commit | 0b314c2ea19f0ae33a1b6c47f8b1140f22e78d2a (patch) | |
tree | 1aa57562958f0d87bafc7bf4ae1dcfc595f0306b /robot/io.h | |
parent | 8995e8b1f29f9c5da4d8c08fafcba53c58ee7947 (diff) | |
parent | b1beaab2e943ba3ad30de22bcc8259f268e2bdae (diff) |
Merge branch 'master' of https://github.com/HoodieJeansJordans/wall-e2 into HoodieJeansJordans-master
Diffstat (limited to 'robot/io.h')
-rw-r--r-- | robot/io.h | 56 |
1 files changed, 54 insertions, 2 deletions
@@ -1,4 +1,56 @@ #pragma once +#include <stdlib.h> +#include <stdint.h> +#include <stdbool.h> +#define FRONT_SENSOR_PIN 5 +#define SIDE_SENSOR_PIN 7 +#define BATTERY_PIN 6 -/** i/o module main */ -void w2_io_main(); +//inputs + +typedef struct { + bool pressed; +} w2_s_io_push; + +typedef struct { + uint16_t range; + +} w2_s_io_contrast; + +typedef struct { + uint16_t detection; +} w2_s_io_distance; + +//outputs + +typedef struct { + int speed; +} w2_s_io_motor; + +typedef struct { + bool toggle; +} w2_s_io_led; + +typedef struct { + char text[16]; +} w2_s_io_display; +typedef struct { + uint8_t charged; +} w2_s_io_battery; + +//all i/o + +typedef struct { + w2_s_i_push button[5]; + w2_s_i_contrast qtrSensor[5]; + w2_s_i_distance frontDetection; + w2_s_i_distance sideDetection; + w2_s_i_battery batteryLevel; + + + w2_s_o_motor motor_left; + w2_s_o_motor motor_right; + w2_s_o_led led_red; + w2_s_o_led led_green; + w2_s_o_display lcd; +} w2_io_all; |