Newer
Older
/*****************************************************************************************************
* PIN LAYOUT
* This file is used by other classes to define the pins used for the hardware.
*****************************************************************************************************/
#ifndef CONFIGURATION_H
#define CONFIGURATION_H
#include <Arduino.h>
/* Runtime Configuration */
#define DELAY 0
/* Debug Options */
#define DEBUG 0
/* Serial Options */
#define BAUDRATE 115200
#define PING '1'
/* =================================== */
/* Pin layout */
/* =================================== */
/* Motor Pins */
#define VIBRATION_PIN 28
/* Potentiometer Pins */
#define POT0_PIN A3
/* LED Pins */
#define LED_BUILTIN 13
#define SWITCH_PIN1 51
#define SWITCH_PIN2 52
#define SWITCH_PIN3 53
/* =================================== */
/* Resolution */
/* =================================== */
#define ADC_RES 1024
/* Buffer len */
#define DEFAULT_BUFFER_LEN 2560
#define COMBINATION_LEN 3
// Packed attribute specifies each member of the structure or union is placed
// to minimize the memory required.
// Size: 2 bytes probably padded to 16bytes
typedef struct {
uint8_t pin; // What Arduino pin :: 8bits , 1byte
bool val; // What value is that arduino pin :: 8bits, 1byte
} __attribute__((__packed__)) bool_packet_t;
// Packed attribute specifies each member of the structure or union is placed
// to minimize the memory required.
// Size: 3 bytes probably padded to 16bytes
typedef struct {
uint8_t pin; // What type of sensor, accelerometer, button, header etc.
uint16_t val; // Unique identifier for this sensor
} __attribute__((__packed__)) i_packet_t;
/*
// Size: 6 bytes
typedef struct {
uint8_t type; // What type of sensor, accelerometer, button etc. Using type as the header
uint8_t id; // Unique identifier for this sensor
union {
uint8_t data[4];
sensors_u08_t button; // which finger is in contact with the thumb
};
} __attribute__((__packed__)) u08_sensor_packet_t;
*/