Skip to content
Snippets Groups Projects

Config pins fixes

Merged Kyrre Ness Sjobaek requested to merge config_pins_fixes into master
5 files
+ 68
32
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -9,14 +9,14 @@
//Note on Arduino pins used for Ethernet shield,
// AVOID THESE PINS:
// 4/10/11/12/13 (UNO)
// 50/51/52/10/4 (Mega)
// 50/51/52/10/4; 53 unused but it MUST be an output (Mega)
// ***** HARDWARE SIMULATION (FOR DEV) *********
//Uncomment to simulate hardware
#define DUMMY_TEMP
#define DUMMY_SERVO
#define DUMMY_STEPPER
//#define DUMMY_TEMP
//#define DUMMY_SERVO
//#define DUMMY_STEPPER
// ***** NETWORK CONFIG ************************
@@ -27,7 +27,10 @@
//byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x84, 0xEE};
// MAC address for Kyrre's test board
byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x72, 0xF7};
//byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x72, 0xF7};
// MAC address for the Arduino on the 4DRobot
byte mac[] = {0xA8, 0x61, 0x0A, 0xAE, 0x84, 0xEF};
//To use DHCP or not to use DHCP, that's the question.
// Comment out to use static IP configuration
@@ -53,14 +56,15 @@ const size_t output_bufflen = 2048;
// ***** TEMPERATURE SENSOR CONFIG *************
const uint8_t temp_oneWire_pin = 51; // <-- Conflict with ETHERNET!
const uint8_t temp_oneWire_pin = 49;
const size_t temp_numSensors = 1;
const unsigned long temp_update_interval = 1000; //[ms]
// ***** SAMPLE GRABBER SERVO CONFIG ***********
// TODO: Tune stepWait, positions
const int grabber_servo_pin = 9;
// Note: Servo may prefer pin 9 (PWM)?
const int grabber_servo_pin = 47;
const int grabber_closed = 86; //[deg]
const int grabber_open = 130; //[deg]
const int grabber_min = 0; //[deg]
@@ -78,8 +82,8 @@ const size_t stepper_numAxis = 3;
const char stepper_axnames[] = {'X','Y','Z'};
const uint8_t stepper_dir_pin[] = {32,36,40}; //Stepper direction pins (HIGH=positive, LOW=negative)
const uint8_t stepper_step_pin[] = {33,37,41}; //Stepper pulse-to-step pins (pulse HIGH, otherwise low)
const uint8_t stepper_dir_pin[] = {6,9,12}; //Stepper direction pins (HIGH=positive, LOW=negative)
const uint8_t stepper_step_pin[] = {5,8,11}; //Stepper pulse-to-step pins (pulse HIGH, otherwise low)
//Define level for stepper_dir_pin[] to count steps in forward direction
// Used to define the Z axis as zero when on top, so that we can zero it first on top switch,
@@ -90,8 +94,8 @@ const bool stepper_backward[] = {HIGH,LOW,LOW};
//TODO: PIN4 ALSO IN USE BY ETHERNET
//TODO: Verify reproducibility of zeroing, we may need debounce?
const uint8_t stepper_switchMAX_pin[] = {2,5,7}; //positive steps limit switch pins
const uint8_t stepper_switchMIN_pin[] = {3,4,6}; //negative steps limit switch pins
const uint8_t stepper_switchMAX_pin[] = {33,37,41}; //positive steps limit switch pins
const uint8_t stepper_switchMIN_pin[] = {32,36,40}; //negative steps limit switch pins
//TODO: Verify active/inactive -> HIGH/LOW
// Note: Needs pulldown/pullup resistor
// Note: Probably safest to define on-limit = open, so if a switch fails the axis is safe (but stopped)
Loading