Skip to content
Snippets Groups Projects
Configuration.h 1.57 KiB
Newer Older
13035516's avatar
13035516 committed
/*****************************************************************************************************
 * 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

Raymond Chia's avatar
Raymond Chia committed
/* SWITCH Pins */
Raymond Chia's avatar
Raymond Chia committed
#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

13035516's avatar
13035516 committed
/* =================================== */
/* Resolution */
/* =================================== */
#define ADC_RES             1024

/* Buffer len */
#define DEFAULT_BUFFER_LEN  1280
13035516's avatar
13035516 committed
#define COMBINATION_LEN     3

// Packed attribute specifies each member of the structure or union is placed 
// to minimize the memory required.
// Size: 4 bytes probably padded to 16bytes
    uint16_t pin;         // What pin from Arduino
    uint16_t val;         // What is the value read from this pin
} __attribute__((__packed__)) int_packet; 
13035516's avatar
13035516 committed
#endif