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
/* ACCELEROMETER Pins */
#define XACC_PIN A0
#define YACC_PIN A1
#define ZACC_PIN A2
/* =================================== */
/* Resolution */
/* =================================== */
#define ADC_RES 1024
/* Buffer len */
// Packed attribute specifies each member of the structure or union is placed
// to minimize the memory required.
// Size: 4 bytes probably padded to 16bytes
typedef struct {
uint16_t pin; // What pin from Arduino
uint16_t val; // What is the value read from this pin
} __attribute__((__packed__)) int_packet;