├── .gitignore ├── 0816feeder.componentinfo.xml ├── shields_def.h ├── shield.h ├── README.md ├── 0816feeder.atsln ├── shield_sensor.h ├── shield_native.h ├── Feeder.h ├── config.h ├── 0816feeder.ino ├── gcode.ino ├── Feeder.cpp └── 0816feeder.cppproj /.gitignore: -------------------------------------------------------------------------------- 1 | /Debug 2 | /__vm 3 | /.vs 4 | -------------------------------------------------------------------------------- /0816feeder.componentinfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /shields_def.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHIELDS_h 2 | #define _SHIELDS_h 3 | 4 | #define SHIELD_NATIVE 1 5 | #define SHIELD_SENSOR 2 6 | 7 | #define SHIELD(shield) (CONTROLLER_SHIELD==SHIELD_##shield) 8 | 9 | 10 | //DEFINE _SHIELDS_h-ENDIF!!! 11 | #endif 12 | -------------------------------------------------------------------------------- /shield.h: -------------------------------------------------------------------------------- 1 | #ifndef _SHIELD_h 2 | #define _SHIELD_h 3 | #include "shields_def.h" 4 | 5 | #if SHIELD(NATIVE) 6 | #include "shield_native.h" 7 | #elif SHIELD(SENSOR) 8 | #include "shield_sensor.h" 9 | #else 10 | #error "invalid board, please select a proper shield" 11 | #endif 12 | 13 | //DEFINE _SHIELD_h-ENDIF!!! 14 | #endif 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 0816 automatic feeder controller firmware 2 | 3 | Automatic feeder system to for OpenPnP. 4 | Details see https://docs.mgrl.de/maschine:pickandplace:feeder:0816feeder 5 | 6 | ![feeder in cad model](https://user-images.githubusercontent.com/3868450/34632854-34719c14-f278-11e7-8e8d-e245edc932fc.jpg) 7 | 8 | https://www.youtube.com/watch?v=vJzb3llKgjA 9 | -------------------------------------------------------------------------------- /0816feeder.atsln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{E66E83B9-2572-4076-B26E-6BE79FF3018A}") = "0816feeder", "0816feeder.cppproj", "{41D67B95-E04C-4F82-A6FA-5E5BD8099F3F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|AVR = Debug|AVR 11 | Release|AVR = Release|AVR 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {41D67B95-E04C-4F82-A6FA-5E5BD8099F3F}.Debug|AVR.ActiveCfg = Debug|AVR 15 | {41D67B95-E04C-4F82-A6FA-5E5BD8099F3F}.Debug|AVR.Build.0 = Debug|AVR 16 | {41D67B95-E04C-4F82-A6FA-5E5BD8099F3F}.Release|AVR.ActiveCfg = Release|AVR 17 | {41D67B95-E04C-4F82-A6FA-5E5BD8099F3F}.Release|AVR.Build.0 = Release|AVR 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /shield_sensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * capabilities 3 | */ 4 | #define NUMBER_OF_FEEDER 48 5 | #define NO_ENABLE_PIN 6 | #define NO_FEEDBACKLINES 7 | #define NO_ANALOG_IN 8 | #define NO_POWER_OUTPUTS 9 | 10 | 11 | 12 | /* 13 | * feederPinMap: Map IO-pins to specific feeder. First feeder is at index 0 (N0). Last feeder is NUMBER_OF_FEEDER-1 14 | */ 15 | const static uint8_t feederPinMap[NUMBER_OF_FEEDER] = { 16 | 7,6,5,4, // Feeder N0...N3 17 | 22,23,24,25, 18 | 26,27,28,29, 19 | 30,31,32,33, 20 | 34,35,36,37, 21 | 38,39,40,41, 22 | 42,43,44,45, 23 | 46,47,48,49, 24 | A0,A1,A2,A3, 25 | A4,A5,A6,A7, 26 | A8,A9,A10,A11, 27 | A12,A13,A14,A15, 28 | }; 29 | 30 | 31 | /* 32 | * feederFeedbackPinMap: Map IO-pins to feedback-line to specific feeder. First feeder is at index 0 (N0). Last feeder is NUMBER_OF_FEEDER-1 33 | * Feedback-line is usually connected to a microswitch to determine whether the feeder has a tape loaded and cover tape is tensioned 34 | * 35 | * to disable feedback-functionality completely at compile-time set pin to -1 36 | */ 37 | const static int8_t feederFeedbackPinMap[NUMBER_OF_FEEDER] = { 38 | -1,-1,-1,-1, 39 | -1,-1,-1,-1, 40 | -1,-1,-1,-1, 41 | -1,-1,-1,-1, 42 | -1,-1,-1,-1, 43 | -1,-1,-1,-1, 44 | -1,-1,-1,-1, 45 | -1,-1,-1,-1, 46 | -1,-1,-1,-1, 47 | -1,-1,-1,-1, 48 | -1,-1,-1,-1, 49 | -1,-1,-1,-1, 50 | }; 51 | 52 | /* 53 | * FEEDER_ENABLE_PIN 54 | * IO-pin with a mosfet to switch power to all feeder on/off 55 | * 56 | * TODO: feature can't be disabled until today 57 | */ 58 | #define FEEDER_ENABLE_PIN 8 59 | 60 | 61 | 62 | /* ---------------- 63 | MOSFET power output pinmap 64 | 65 | on pcb 4 output are prepared. output 1 is at index 0 in pwrOutputPinMap 66 | */ 67 | 68 | #define NUMBER_OF_POWER_OUTPUT 0 69 | const static uint8_t pwrOutputPinMap[NUMBER_OF_POWER_OUTPUT] = { 70 | 71 | }; 72 | 73 | -------------------------------------------------------------------------------- /shield_native.h: -------------------------------------------------------------------------------- 1 | /* 2 | * capabilities 3 | */ 4 | #define NUMBER_OF_FEEDER 24 5 | #define HAS_ENABLE_PIN 6 | #define HAS_FEEDBACKLINES 7 | #define HAS_ANALOG_IN 8 | #define HAS_POWER_OUTPUTS 9 | 10 | /* 11 | * feederPinMap: Map IO-pins to specific feeder. First feeder is at index 0 (N0). Last feeder is NUMBER_OF_FEEDER-1 12 | */ 13 | const static uint8_t feederPinMap[NUMBER_OF_FEEDER] = { 14 | 13, // Feeder N0 15 | 11, // Feeder N1 16 | 9, //... 17 | 7, 18 | 5, 19 | 3, 20 | 21 | 14, // Feeder N6 22 | 16, 23 | 18, 24 | 22, 25 | 24, 26 | 26, 27 | 28 | 30, // Feeder N12 29 | 32, 30 | 34, 31 | 36, 32 | 38, 33 | 40, 34 | 35 | 42, //Feeder N18 36 | 44, 37 | 46, 38 | 48, 39 | 50, 40 | 52, // Feeder N23 41 | }; 42 | 43 | 44 | /* 45 | * feederFeedbackPinMap: Map IO-pins to feedback-line to specific feeder. First feeder is at index 0 (N0). Last feeder is NUMBER_OF_FEEDER-1 46 | * Feedback-line is usually connected to a microswitch to determine whether the feeder has a tape loaded and cover tape is tensioned 47 | * 48 | * to disable feedback-functionality completely at compile-time set pin to -1 49 | */ 50 | const static int8_t feederFeedbackPinMap[NUMBER_OF_FEEDER] = { 51 | 12, // Feeder N0 52 | 10, // Feeder N1 53 | 8, //... 54 | 6, 55 | 4, 56 | 2, 57 | 58 | 15, // Feeder N6 59 | 17, 60 | 19, 61 | 23, 62 | 25, 63 | 27, 64 | 65 | 31, // Feeder N12 66 | 33, 67 | 35, 68 | 37, 69 | 39, 70 | 41, 71 | 72 | 43, // Feeder N18 73 | 45, 74 | 47, 75 | 49, 76 | 51, 77 | 53, // Feeder N23 78 | 79 | }; 80 | 81 | /* 82 | * FEEDER_ENABLE_PIN 83 | * IO-pin with a mosfet to switch power to all feeder on/off 84 | * 85 | * TODO: feature can't be disabled until today 86 | */ 87 | #define FEEDER_ENABLE_PIN A15 88 | 89 | 90 | 91 | /* ---------------- 92 | MOSFET power output pinmap 93 | 94 | on pcb 4 output are prepared. output 1 is at index 0 in pwrOutputPinMap 95 | */ 96 | 97 | #define NUMBER_OF_POWER_OUTPUT 4 98 | const static uint8_t pwrOutputPinMap[NUMBER_OF_POWER_OUTPUT] = { 99 | A11, // Output 1 (D0) 100 | A12, // Output 2 (D1) 101 | A13, //... 102 | A14, 103 | }; 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /Feeder.h: -------------------------------------------------------------------------------- 1 | #ifndef _FEEDER_h 2 | #define _FEEDER_h 3 | 4 | #include "arduino.h" 5 | #include "config.h" 6 | #include "shield.h" 7 | #include 8 | #include 9 | 10 | 11 | 12 | class FeederClass { 13 | protected: 14 | 15 | //on initialize it gets a number. Off feederNo the location EEPROM settings are stored is derived. Nothing else so: TODO: make it obsolete 16 | int feederNo=-1; 17 | 18 | 19 | enum tFeederErrorState { 20 | sOK=0, 21 | sOK_NOFEEDBACKLINE=1, 22 | sERROR_IGNORED=2, 23 | sERROR=-1, 24 | } ; 25 | tFeederErrorState getFeederErrorState(); 26 | 27 | public: 28 | 29 | 30 | //used to transfer settings between different objects 31 | struct sFeederSettings { 32 | uint8_t full_advanced_angle; 33 | uint8_t half_advanced_angle; 34 | uint8_t retract_angle; 35 | uint8_t feed_length; 36 | int time_to_settle; 37 | int motor_min_pulsewidth; 38 | int motor_max_pulsewidth; 39 | #ifdef HAS_FEEDBACKLINES 40 | uint8_t ignore_feedback; 41 | #endif 42 | //sFeederState lastFeederState; //save last position to stay there on poweron? needs something not to wear out the eeprom. until now just go to retract pos. 43 | }; 44 | 45 | uint8_t remainingFeedLength=0; 46 | 47 | //operational status of the feeder 48 | enum sFeederState { 49 | sDISABLED, 50 | sIDLE, 51 | sMOVING, 52 | sADVANCING_CYCLE_COMPLETED, 53 | } feederState = sDISABLED; 54 | 55 | //store the position of the advancing lever 56 | //last state is stored to enable half advance moves (2mm tapes) 57 | enum sFeederPosition { 58 | sAT_UNKNOWN, 59 | sAT_FULL_ADVANCED_POSITION, 60 | sAT_HALF_ADVANCED_POSITION, 61 | sAT_RETRACT_POSITION, 62 | 63 | } lastFeederPosition = sAT_UNKNOWN, feederPosition = sAT_UNKNOWN; 64 | 65 | //store last tinestamp position changed to respect a settle time 66 | unsigned long lastTimePositionChange; 67 | 68 | //some variables for utilizing the feedbackline to feed for setup the feeder... 69 | uint8_t feedbackLineTickCounter=0; 70 | unsigned long lastTimeFeedbacklineCheck; 71 | int lastButtonState; 72 | 73 | //permanently in eeprom stored settings 74 | sFeederSettings feederSettings = { 75 | FEEDER_DEFAULT_FULL_ADVANCED_ANGLE, 76 | FEEDER_DEFAULT_HALF_ADVANCED_ANGLE, 77 | FEEDER_DEFAULT_RETRACT_ANGLE, 78 | FEEDER_DEFAULT_FEED_LENGTH, 79 | FEEDER_DEFAULT_TIME_TO_SETTLE, 80 | FEEDER_DEFAULT_MOTOR_MIN_PULSEWIDTH, 81 | FEEDER_DEFAULT_MOTOR_MAX_PULSEWITH, 82 | #ifdef HAS_FEEDBACKLINES 83 | FEEDER_DEFAULT_IGNORE_FEEDBACK, 84 | #endif 85 | }; 86 | 87 | Servo servo; 88 | 89 | void initialize(uint8_t _feederNo); 90 | bool isInitialized(); 91 | bool hasFeedbackLine(); 92 | void outputCurrentSettings(); 93 | void setup(); 94 | sFeederSettings getSettings(); 95 | void setSettings(sFeederSettings UpdatedFeederSettings); 96 | void loadFeederSettings(); 97 | void saveFeederSettings(); 98 | void factoryReset(); 99 | 100 | void gotoPostPickPosition(); 101 | void gotoRetractPosition(); 102 | void gotoHalfAdvancedPosition(); 103 | void gotoFullAdvancedPosition(); 104 | void gotoAngle(uint8_t angle); 105 | bool advance(uint8_t feedLength, bool overrideError); 106 | 107 | String reportFeederErrorState(); 108 | bool feederIsOk(); 109 | 110 | void enable(); 111 | void disable(); 112 | 113 | void update(); 114 | }; 115 | 116 | extern FeederClass Feeder; 117 | 118 | 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /config.h: -------------------------------------------------------------------------------- 1 | #ifndef _CONFIG_h 2 | #define _CONFIG_h 3 | #include "arduino.h" 4 | 5 | 6 | /* 7 | * DEBUG 8 | */ 9 | // prints some extra information via serial 10 | // uncomment to disable in production 11 | //#define DEBUG 12 | 13 | /* 14 | * Select controller shield 15 | */ 16 | // defaults to the native shield, optional sensor shield can be selected 17 | #define CONTROLLER_SHIELD SHIELD_NATIVE //SHIELD_NATIVE or SHIELD_SENSOR 18 | //change config_version, if change shield! 19 | 20 | 21 | /* 22 | * EEPROM-Settings 23 | */ 24 | //change to something other unique if structure of data to be saved in eeprom changed (max 3 chars) 25 | #define CONFIG_VERSION "aab" 26 | 27 | /* 28 | * Serial 29 | */ 30 | #define SERIAL_BAUD 115200 31 | 32 | 33 | /* ----------------------------------------------------------------- 34 | * FEEDER CONFIG 35 | * ----------------------------------------------------------------- 36 | * default settings per feeder 37 | 38 | // calculate angles: https://de.wikipedia.org/wiki/Schubkurbel, crankshift 39 | 40 | 41 | when setting these values, make sure, the values for 42 | FEEDER_DEFAULT_MOTOR_MIN_PULSEWIDTH and 43 | FEEDER_DEFAULT_MOTOR_MAX_PULSEWITH 44 | reflect the according position for servo being used 45 | 46 | when everything is setup right, the lever is in advanced position at servo-angle ~90 degree 47 | fully retracted is about ~20° 48 | 49 | 50 | | STATE RETRACTED, looking from the top 51 | | 52 | | . 53 | | /_\ 54 | | | <- direction tape is advanced 55 | | | 56 | | 57 | | -x----- <- advancing lever, x falls into the hole of a tape and advances it. 58 | | ------- 59 | | ---- 60 | | ---- 61 | | ---- 62 | | ---- 63 | | ------- 64 | | ------- 65 | | ------- 66 | | -\\o\\- <- piston / Pleuelstange 67 | | \\\\\ 68 | | \\\\\ 69 | | \\\\\ 70 | | \\\\\ 71 | | O====o\\ 72 | | ^ \\\\\ 73 | | \_ servo-motor at FEEDER_DEFAULT_RETRACT_ANGLE (about 20°) 74 | 75 | | STATE FULL ADVANCED, looking from the top 76 | | 77 | | . 78 | | /_\ 79 | | | <- direction tape is advanced 80 | | | 81 | | 82 | | -x----- <- advancing lever, x falls into the hole of a tape and advances it. 83 | | ------- 84 | | ---- 85 | | ---- 86 | | ---- 87 | | ---- 88 | | ------- 89 | | ------- 90 | | ------- 91 | | -||o||- <- piston / Pleuelstange 92 | | ||||| 93 | | ||||| 94 | | ||||| 95 | | ||||| 96 | | ||||| 97 | | ||o|| 98 | | : 99 | | : <- arm of servo motor fully extended 100 | | : 101 | | : 102 | | 0 <- servo-motor at FEEDER_DEFAULT_FULL_ADVANCED_ANGLE (about 90°) 103 | 104 | */ 105 | #define FEEDER_DEFAULT_FULL_ADVANCED_ANGLE 90 // [°] usually 90 (type: uint8_t) 106 | #define FEEDER_DEFAULT_HALF_ADVANCED_ANGLE 44 // [°] exact math would be 43.85. may need tweaking. only needed if advancing half pitch (for 0401 smds) (type: uint8_t) 107 | #define FEEDER_DEFAULT_RETRACT_ANGLE 15 // [°] usually 20, chose 15 to be failsafe (type: uint8_t) 108 | #define FEEDER_DEFAULT_FEED_LENGTH FEEDER_MECHANICAL_ADVANCE_LENGTH // [mm] distance to be fed if no feedlength was given in a feed command 109 | #define FEEDER_DEFAULT_TIME_TO_SETTLE 240 // [ms] time the servo needs to travel from FEEDER_DEFAULT_FULL_ADVANCED_ANGLE to FEEDER_DEFAULT_RETRACT_ANGLE (type: uint8_t -> max 255ms) 110 | /* 111 | 0° == ~ 544 µs --> min, default 544 and seems it fits to the sg90 from tower pro 112 | 90° == --> "middle" 113 | 180° == ~2400 µs --> max, default 2400 and seems it fits to the sg90 from tower pro 114 | --> SERVO.attach(PIN, 544, 2400); 115 | */ 116 | #define FEEDER_DEFAULT_MOTOR_MIN_PULSEWIDTH 544 // [µs] see motor specs or experiment at bit. Value set here should bring the servo to 0° 117 | #define FEEDER_DEFAULT_MOTOR_MAX_PULSEWITH 2400 // [µs] see motor specs or experiment at bit. Value set here should bring the servo to 180° 118 | #define FEEDER_DEFAULT_IGNORE_FEEDBACK 0 // 0: before feeding the feedback-signal is checked. if signal is as expected, the feeder advances tape and returns OK to host. otherwise an error is thrown. 119 | // 1: the feedback-signal is not checked, feeder advances tape and returns OK always 120 | 121 | 122 | /* ---------------- 123 | Analog Reading Config 124 | */ 125 | // ADC is polled regularly and scaled afterwards. When a command is issued, the pre-calculated values are sent to host immediately. 126 | #define ADC_READ_EVERY_MS 20 127 | 128 | // Scaling Factors to convert raw ADC value to real units. 129 | #define ANALOG_A0_SCALING_FACTOR 0.1277 //preset for NXP vacuum sensor, formula pressure [kPa]=(ADCval/1023-0.92)/0.007652 130 | #define ANALOG_A0_OFFSET -120.23 131 | #define ANALOG_A1_SCALING_FACTOR 0.1277 //preset for NXP vacuum sensor, formula pressure [kPa]=(ADCval/1023-0.92)/0.007652 132 | #define ANALOG_A1_OFFSET -120.23 133 | #define ANALOG_A2_SCALING_FACTOR 1 134 | #define ANALOG_A2_OFFSET 0 135 | #define ANALOG_A3_SCALING_FACTOR 1 136 | #define ANALOG_A3_OFFSET 0 137 | #define ANALOG_A4_SCALING_FACTOR 1 138 | #define ANALOG_A4_OFFSET 0 139 | #define ANALOG_A5_SCALING_FACTOR 1 140 | #define ANALOG_A5_OFFSET 0 141 | #define ANALOG_A6_SCALING_FACTOR 1 142 | #define ANALOG_A6_OFFSET 0 143 | #define ANALOG_A7_SCALING_FACTOR 1 144 | #define ANALOG_A7_OFFSET 0 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | // ------------------------------------------------------ 153 | // 154 | // 155 | // 156 | // 157 | // 158 | // 159 | // 160 | // STOP 161 | // do not edit stuff below this line... 162 | // 163 | // 164 | // 165 | // 166 | // 167 | // 168 | // 169 | // 170 | // ------------------------------------------------------ 171 | 172 | 173 | 174 | 175 | //where in eeprom to store common settings and feeder specific data 176 | #define EEPROM_COMMON_SETTINGS_ADDRESS_OFFSET 4 177 | #if CONTROLLER_SHIELD == NATIVE_SHIELD 178 | #define EEPROM_FEEDER_SETTINGS_ADDRESS_OFFSET 128 179 | #else 180 | #define EEPROM_FEEDER_SETTINGS_ADDRESS_OFFSET 8 181 | #endif 182 | 183 | //buffer size for serial commands received 184 | #define MAX_BUFFFER_MCODE_LINE 64 // no line can be longer than this 185 | 186 | //to calculate how often advancing has to be repeated if commanded to advance more than 4 millimeter per feed 187 | #define FEEDER_MECHANICAL_ADVANCE_LENGTH 4 // [mm] default: 4 mm. fixed as per mechanical design. 188 | 189 | /* ----------------------------------------------------------------- 190 | * M-CODES 191 | * ----------------------------------------------------------------- */ 192 | 193 | 194 | #define MCODE_ADVANCE 600 195 | #define MCODE_RETRACT_POST_PICK 601 196 | #define MCODE_FEEDER_IS_OK 602 197 | #define MCODE_SERVO_SET_ANGLE 603 198 | #define MCODE_SET_FEEDER_ENABLE 610 199 | #define MCODE_UPDATE_FEEDER_CONFIG 620 200 | 201 | #define MCODE_GET_ADC_RAW 143 202 | #define MCODE_GET_ADC_SCALED 144 203 | #define MCODE_SET_SCALING 145 204 | 205 | #define MCODE_SET_POWER_OUTPUT 155 206 | 207 | #define MCODE_FACTORY_RESET 799 208 | 209 | 210 | 211 | //DEFINE config_h-ENDIF!!! 212 | #endif 213 | -------------------------------------------------------------------------------- /0816feeder.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: mgrl 3 | * (c)2017-12-30 4 | * 5 | * This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. 6 | * http://creativecommons.org/licenses/by-nc-sa/4.0/ 7 | * 8 | * current version: v0.3 9 | * 10 | * CHANGELOG: 11 | * v0.2 12 | * - added support for sensor shield (experimental, no feedbackline supported) 13 | * v0.3 14 | * - better checking for manual feed (enhanced reliability not to conflict with g-code issued feeds) 15 | * - improved setup sequence 16 | * - default angle for 2mm feeds corrected according to math 17 | * 18 | */ 19 | 20 | #include "config.h" 21 | #include "shield.h" 22 | 23 | // ------------------ I N C L I B R A R I E S --------------- 24 | #include 25 | #include 26 | #include "Feeder.h" 27 | 28 | // ------------------ V A R S E T U P ----------------------- 29 | 30 | // ------ Feeder 31 | FeederClass feeders[NUMBER_OF_FEEDER]; 32 | enum eFeederEnabledState { 33 | DISABLED, 34 | ENABLED, 35 | } feederEnabled=DISABLED; 36 | 37 | // ------ Settings-Struct (saved in EEPROM) 38 | struct sCommonSettings { 39 | 40 | //add further settings here 41 | 42 | char version[4]; // This is for detection if settings suit to struct, if not, eeprom is reset to defaults 43 | #ifdef HAS_ANALOG_IN 44 | float adc_scaling_values[8][2]; 45 | #endif 46 | }; 47 | sCommonSettings commonSettings_default = { 48 | 49 | //add further settings here 50 | 51 | CONFIG_VERSION, 52 | 53 | #ifdef HAS_ANALOG_IN 54 | { 55 | {ANALOG_A0_SCALING_FACTOR,ANALOG_A0_OFFSET}, 56 | {ANALOG_A1_SCALING_FACTOR,ANALOG_A1_OFFSET}, 57 | {ANALOG_A2_SCALING_FACTOR,ANALOG_A2_OFFSET}, 58 | {ANALOG_A3_SCALING_FACTOR,ANALOG_A3_OFFSET}, 59 | {ANALOG_A4_SCALING_FACTOR,ANALOG_A4_OFFSET}, 60 | {ANALOG_A5_SCALING_FACTOR,ANALOG_A5_OFFSET}, 61 | {ANALOG_A6_SCALING_FACTOR,ANALOG_A6_OFFSET}, 62 | {ANALOG_A7_SCALING_FACTOR,ANALOG_A7_OFFSET}, 63 | }, 64 | #endif 65 | }; 66 | sCommonSettings commonSettings; 67 | 68 | // ------ ADC readout 69 | unsigned long lastTimeADCread; 70 | uint16_t adcRawValues[8]; 71 | float adcScaledValues[8]; 72 | 73 | // ------------------ U T I L I T I E S --------------- 74 | 75 | // ------ Operate command on all feeder 76 | enum eFeederCommands { 77 | cmdSetup, 78 | cmdUpdate, 79 | 80 | cmdEnable, 81 | cmdDisable, 82 | 83 | cmdOutputCurrentSettings, 84 | cmdInitializeFeederWithId, 85 | cmdFactoryReset, 86 | 87 | }; 88 | void executeCommandOnAllFeeder(eFeederCommands command); 89 | void executeCommandOnAllFeeder(eFeederCommands command) { 90 | for (uint8_t i=0;i= ADC_READ_EVERY_MS) { 225 | lastTimeADCread=millis(); 226 | 227 | updateADCvalues(); 228 | } 229 | #endif 230 | } 231 | -------------------------------------------------------------------------------- /gcode.ino: -------------------------------------------------------------------------------- 1 | String inputBuffer = ""; // Buffer for incoming G-Code lines 2 | 3 | 4 | /** 5 | * Look for character /code/ in the inputBuffer and read the float that immediately follows it. 6 | * @return the value found. If nothing is found, /defaultVal/ is returned. 7 | * @input code the character to look for. 8 | * @input defaultVal the return value if /code/ is not found. 9 | **/ 10 | float parseParameter(char code,float defaultVal) { 11 | int codePosition = inputBuffer.indexOf(code); 12 | if(codePosition!=-1) { 13 | //code found in buffer 14 | 15 | //find end of number (separated by " " (space)) 16 | int delimiterPosition = inputBuffer.indexOf(" ",codePosition+1); 17 | 18 | float parsedNumber = inputBuffer.substring(codePosition+1,delimiterPosition).toFloat(); 19 | 20 | return parsedNumber; 21 | } else { 22 | return defaultVal; 23 | } 24 | 25 | } 26 | 27 | void setupGCodeProc() { 28 | inputBuffer.reserve(MAX_BUFFFER_MCODE_LINE); 29 | } 30 | 31 | void sendAnswer(uint8_t error, String message) { 32 | if(error==0) 33 | Serial.print(F("ok ")); 34 | else 35 | Serial.print(F("error ")); 36 | 37 | Serial.println(message); 38 | } 39 | 40 | bool validFeederNo(int8_t signedFeederNo, uint8_t feederNoMandatory = 0) { 41 | if(signedFeederNo == -1 && feederNoMandatory >= 1) { 42 | //no number given (-1) but it is mandatory. 43 | return false; 44 | } else { 45 | //state now: number is given, check for valid range 46 | if(signedFeederNo<0 || signedFeederNo>(NUMBER_OF_FEEDER-1)) { 47 | //error, number not in a valid range 48 | return false; 49 | } else { 50 | //perfectly fine number 51 | return true; 52 | } 53 | } 54 | } 55 | 56 | /** 57 | * Read the input buffer and find any recognized commands. One G or M command per line. 58 | */ 59 | void processCommand() { 60 | 61 | //get the command, default -1 if no command found 62 | int cmd = parseParameter('M',-1); 63 | 64 | #ifdef DEBUG 65 | Serial.print("command found: M"); 66 | Serial.println(cmd); 67 | #endif 68 | 69 | 70 | switch(cmd) { 71 | 72 | /* 73 | FEEDER-CODES 74 | */ 75 | 76 | 77 | case MCODE_SET_FEEDER_ENABLE: { 78 | 79 | int8_t _feederEnabled=parseParameter('S',-1); 80 | if( (_feederEnabled==0 || _feederEnabled==1) ) { 81 | 82 | if((uint8_t)_feederEnabled==1) { 83 | digitalWrite(FEEDER_ENABLE_PIN, HIGH); 84 | feederEnabled=ENABLED; 85 | 86 | executeCommandOnAllFeeder(cmdEnable); 87 | 88 | sendAnswer(0,F("Feeder set enabled and operational")); 89 | } else { 90 | digitalWrite(FEEDER_ENABLE_PIN, LOW); 91 | feederEnabled=DISABLED; 92 | 93 | executeCommandOnAllFeeder(cmdDisable); 94 | 95 | sendAnswer(0,F("Feeder set disabled")); 96 | } 97 | } else if(_feederEnabled==-1) { 98 | sendAnswer(0,("current powerState: ") + String(feederEnabled)); 99 | } else { 100 | sendAnswer(1,F("Invalid parameters")); 101 | } 102 | 103 | 104 | break; 105 | } 106 | 107 | 108 | case MCODE_ADVANCE: { 109 | //1st to check: are feeder enabled? 110 | if(feederEnabled!=ENABLED) { 111 | sendAnswer(1,String(String("Enable feeder first! M") + String(MCODE_SET_FEEDER_ENABLE) + String(" S1"))); 112 | break; 113 | } 114 | 115 | int8_t signedFeederNo = (int)parseParameter('N',-1); 116 | int8_t overrideErrorRaw = (int)parseParameter('X',-1); 117 | bool overrideError = false; 118 | if(overrideErrorRaw >= 1) { 119 | overrideError = true; 120 | #ifdef DEBUG 121 | Serial.println("Argument X1 found, feedbackline/error will be ignored"); 122 | #endif 123 | } 124 | 125 | //check for presence of a mandatory FeederNo 126 | if(!validFeederNo(signedFeederNo,1)) { 127 | sendAnswer(1,F("feederNo missing or invalid")); 128 | break; 129 | } 130 | 131 | //determine feedLength 132 | uint8_t feedLength; 133 | //get feedLength if given, otherwise go for default configured feed_length 134 | feedLength = (uint8_t)parseParameter('F',feeders[(uint8_t)signedFeederNo].feederSettings.feed_length); 135 | 136 | 137 | if ( ((feedLength%2) != 0) || feedLength>24 ) { 138 | //advancing is only possible for multiples of 2mm and 24mm max 139 | sendAnswer(1,F("Invalid feedLength")); 140 | break; 141 | } 142 | #ifdef DEBUG 143 | Serial.print("Determined feedLength "); 144 | Serial.print(feedLength); 145 | Serial.println(); 146 | #endif 147 | 148 | //start feeding 149 | bool triggerFeedOK=feeders[(uint8_t)signedFeederNo].advance(feedLength,overrideError); 150 | if(!triggerFeedOK) { 151 | //report error to host at once, tape was not advanced... 152 | sendAnswer(1,F("feeder not OK (not activated, no tape or tension of cover tape not OK)")); 153 | } else { 154 | //answer OK to host in case there was no error -> NO, no answer now: 155 | //wait to send OK, until feed process finished. otherwise the pickup is started immediately, thus too early. 156 | //message is fired off in feeder.cpp 157 | } 158 | 159 | 160 | break; 161 | } 162 | 163 | case MCODE_RETRACT_POST_PICK: { 164 | //1st to check: are feeder enabled? 165 | if(feederEnabled!=ENABLED) { 166 | sendAnswer(1,String(String("Enable feeder first! M") + String(MCODE_SET_FEEDER_ENABLE) + String(" S1"))); 167 | break; 168 | } 169 | 170 | 171 | int8_t signedFeederNo = (int)parseParameter('N',-1); 172 | 173 | //check for presence of FeederNo 174 | if(!validFeederNo(signedFeederNo,1)) { 175 | sendAnswer(1,F("feederNo missing or invalid")); 176 | break; 177 | } 178 | 179 | feeders[(uint8_t)signedFeederNo].gotoPostPickPosition(); 180 | 181 | sendAnswer(0,F("feeder postPickRetract done if needed")); 182 | 183 | break; 184 | } 185 | 186 | case MCODE_FEEDER_IS_OK: { 187 | int8_t signedFeederNo = (int)parseParameter('N',-1); 188 | 189 | //check for presence of FeederNo 190 | if(!validFeederNo(signedFeederNo,1)) { 191 | sendAnswer(1,F("feederNo missing or invalid")); 192 | break; 193 | } 194 | 195 | sendAnswer(0,feeders[(uint8_t)signedFeederNo].reportFeederErrorState()); 196 | 197 | break; 198 | } 199 | 200 | case MCODE_SERVO_SET_ANGLE: { 201 | //1st to check: are feeder enabled? 202 | if(feederEnabled!=ENABLED) { 203 | sendAnswer(1,String(String("Enable feeder first! M") + String(MCODE_SET_FEEDER_ENABLE) + String(" S1"))); 204 | break; 205 | } 206 | 207 | 208 | int8_t signedFeederNo = (int)parseParameter('N',-1); 209 | uint8_t angle = (int)parseParameter('A',90); 210 | 211 | //check for presence of FeederNo 212 | if(!validFeederNo(signedFeederNo,1)) { 213 | sendAnswer(1,F("feederNo missing or invalid")); 214 | break; 215 | } 216 | //check for valid angle 217 | if( angle>180 ) { 218 | sendAnswer(1,F("illegal angle")); 219 | break; 220 | } 221 | 222 | feeders[(uint8_t)signedFeederNo].gotoAngle(angle); 223 | 224 | sendAnswer(0,F("angle set")); 225 | 226 | break; 227 | } 228 | 229 | case MCODE_UPDATE_FEEDER_CONFIG: { 230 | int8_t signedFeederNo = (int)parseParameter('N',-1); 231 | 232 | //check for presence of FeederNo 233 | if(!validFeederNo(signedFeederNo,1)) { 234 | sendAnswer(1,F("feederNo missing or invalid")); 235 | break; 236 | } 237 | 238 | //merge given parameters to old settings 239 | FeederClass::sFeederSettings oldFeederSettings=feeders[(uint8_t)signedFeederNo].getSettings(); 240 | FeederClass::sFeederSettings updatedFeederSettings; 241 | updatedFeederSettings.full_advanced_angle=parseParameter('A',oldFeederSettings.full_advanced_angle); 242 | updatedFeederSettings.half_advanced_angle=parseParameter('B',oldFeederSettings.half_advanced_angle); 243 | updatedFeederSettings.retract_angle=parseParameter('C',oldFeederSettings.retract_angle); 244 | updatedFeederSettings.feed_length=parseParameter('F',oldFeederSettings.feed_length); 245 | updatedFeederSettings.time_to_settle=parseParameter('U',oldFeederSettings.time_to_settle); 246 | updatedFeederSettings.motor_min_pulsewidth=parseParameter('V',oldFeederSettings.motor_min_pulsewidth); 247 | updatedFeederSettings.motor_max_pulsewidth=parseParameter('W',oldFeederSettings.motor_max_pulsewidth); 248 | #ifdef HAS_FEEDBACKLINES 249 | updatedFeederSettings.ignore_feedback=parseParameter('X',oldFeederSettings.ignore_feedback); 250 | #endif 251 | 252 | //set to feeder 253 | feeders[(uint8_t)signedFeederNo].setSettings(updatedFeederSettings); 254 | 255 | //save to eeprom 256 | feeders[(uint8_t)signedFeederNo].saveFeederSettings(); 257 | 258 | //reattach servo with new settings 259 | feeders[(uint8_t)signedFeederNo].setup(); 260 | 261 | //confirm 262 | sendAnswer(0,F("Feeders config updated.")); 263 | 264 | break; 265 | } 266 | 267 | /* 268 | CODES to Control ADC 269 | */ 270 | #ifdef HAS_ANALOG_IN 271 | case MCODE_GET_ADC_RAW: { 272 | //answer to host 273 | int8_t channel=parseParameter('A',-1); 274 | if( channel>=0 && channel<8 ) { 275 | 276 | //send value in first line of answer, so it can be parsed by OpenPnP correctly 277 | Serial.println(String("value:")+String(adcRawValues[(uint8_t)channel])); 278 | 279 | //common answer 280 | sendAnswer(0,"value sent"); 281 | } else { 282 | sendAnswer(1,F("invalid adc channel (0...7)")); 283 | } 284 | 285 | break; 286 | } 287 | case MCODE_GET_ADC_SCALED: { 288 | //answer to host 289 | int8_t channel=parseParameter('A',-1); 290 | if( channel>=0 && channel<8 ) { 291 | 292 | //send value in first line of answer, so it can be parsed by OpenPnP correctly 293 | Serial.println(String("value:")+String(adcScaledValues[(uint8_t)channel],4)); 294 | 295 | //common answer 296 | sendAnswer(0,"value sent"); 297 | } else { 298 | sendAnswer(1,F("invalid adc channel (0...7)")); 299 | } 300 | 301 | break; 302 | } 303 | case MCODE_SET_SCALING: { 304 | 305 | int8_t channel=parseParameter('A',-1); 306 | 307 | //check for valid parameters 308 | if( channel>=0 && channel<8 ) { 309 | commonSettings.adc_scaling_values[(uint8_t)channel][0]=parseParameter('S',commonSettings.adc_scaling_values[(uint8_t)channel][0]); 310 | commonSettings.adc_scaling_values[(uint8_t)channel][1]=parseParameter('O',commonSettings.adc_scaling_values[(uint8_t)channel][1]); 311 | 312 | EEPROM.writeBlock(EEPROM_COMMON_SETTINGS_ADDRESS_OFFSET, commonSettings); 313 | 314 | sendAnswer(0,(F("scaling set and stored to eeprom"))); 315 | } else { 316 | sendAnswer(1,F("invalid adc channel (0...7)")); 317 | } 318 | 319 | 320 | break; 321 | } 322 | #endif 323 | 324 | #ifdef HAS_POWER_OUTPUTS 325 | case MCODE_SET_POWER_OUTPUT: { 326 | //answer to host 327 | int8_t powerPin=parseParameter('D',-1); 328 | int8_t powerState=parseParameter('S',-1); 329 | if( (powerPin>=0 && powerPinfeederNo == -1) 6 | return false; 7 | else 8 | return true; 9 | } 10 | 11 | void FeederClass::initialize(uint8_t _feederNo) { 12 | this->feederNo = _feederNo; 13 | } 14 | 15 | #ifdef HAS_FEEDBACKLINES 16 | bool FeederClass::hasFeedbackLine() { 17 | if(feederFeedbackPinMap[this->feederNo] != -1) { 18 | return true; 19 | } else { 20 | return false; 21 | } 22 | } 23 | #endif 24 | 25 | void FeederClass::outputCurrentSettings() { 26 | Serial.print("M"); 27 | Serial.print(MCODE_UPDATE_FEEDER_CONFIG); 28 | Serial.print(" N"); 29 | Serial.print(this->feederNo); 30 | Serial.print(" A"); 31 | Serial.print(this->feederSettings.full_advanced_angle); 32 | Serial.print(" B"); 33 | Serial.print(this->feederSettings.half_advanced_angle); 34 | Serial.print(" C"); 35 | Serial.print(this->feederSettings.retract_angle); 36 | Serial.print(" F"); 37 | Serial.print(this->feederSettings.feed_length); 38 | Serial.print(" U"); 39 | Serial.print(this->feederSettings.time_to_settle); 40 | Serial.print(" V"); 41 | Serial.print(this->feederSettings.motor_min_pulsewidth); 42 | Serial.print(" W"); 43 | Serial.print(this->feederSettings.motor_max_pulsewidth); 44 | #ifdef HAS_FEEDBACKLINES 45 | Serial.print(" X"); 46 | Serial.print(this->feederSettings.ignore_feedback); 47 | #endif 48 | Serial.println(); 49 | } 50 | 51 | void FeederClass::setup() { 52 | //load settings from eeprom 53 | this->loadFeederSettings(); 54 | 55 | //attach servo to pin, after settings are loaded 56 | this->servo.attach(feederPinMap[this->feederNo],this->feederSettings.motor_min_pulsewidth,this->feederSettings.motor_max_pulsewidth); 57 | 58 | //feedback input 59 | //microswitch is active low (NO connected to feedback-pin) 60 | #ifdef HAS_FEEDBACKLINES 61 | if(this->hasFeedbackLine()) 62 | pinMode((uint8_t)feederFeedbackPinMap[this->feederNo],INPUT_PULLUP); 63 | 64 | this->lastButtonState=digitalRead(feederFeedbackPinMap[this->feederNo]); 65 | #endif 66 | 67 | //put on defined position 68 | this->gotoRetractPosition(); 69 | } 70 | 71 | FeederClass::sFeederSettings FeederClass::getSettings() { 72 | return this->feederSettings; 73 | } 74 | 75 | void FeederClass::setSettings(sFeederSettings UpdatedFeederSettings) { 76 | this->feederSettings=UpdatedFeederSettings; 77 | 78 | 79 | #ifdef DEBUG 80 | Serial.println(F("updated feeder settings")); 81 | this->outputCurrentSettings(); 82 | #endif 83 | } 84 | 85 | void FeederClass::loadFeederSettings() { 86 | uint16_t adressOfFeederSettingsInEEPROM = EEPROM_FEEDER_SETTINGS_ADDRESS_OFFSET + this->feederNo * sizeof(this->feederSettings); 87 | EEPROM.readBlock(adressOfFeederSettingsInEEPROM, this->feederSettings); 88 | 89 | #ifdef DEBUG 90 | Serial.println(F("loaded settings from eeprom:")); 91 | this->outputCurrentSettings(); 92 | #endif 93 | } 94 | 95 | void FeederClass::saveFeederSettings() { 96 | uint16_t adressOfFeederSettingsInEEPROM = EEPROM_FEEDER_SETTINGS_ADDRESS_OFFSET + this->feederNo * sizeof(this->feederSettings); 97 | EEPROM.writeBlock(adressOfFeederSettingsInEEPROM, this->feederSettings); 98 | 99 | 100 | #ifdef DEBUG 101 | Serial.println(F("stored settings to eeprom:")); 102 | this->outputCurrentSettings(); 103 | #endif 104 | } 105 | 106 | void FeederClass::factoryReset() { 107 | //just save the defaults to eeprom... 108 | 109 | this->saveFeederSettings(); 110 | } 111 | 112 | 113 | void FeederClass::gotoPostPickPosition() { 114 | if(this->feederPosition==sAT_FULL_ADVANCED_POSITION) { 115 | this->gotoRetractPosition(); 116 | #ifdef DEBUG 117 | Serial.println("gotoPostPickPosition retracted feeder"); 118 | #endif 119 | } else { 120 | #ifdef DEBUG 121 | Serial.println("gotoPostPickPosition didn't need to retract feeder"); 122 | #endif 123 | 124 | } 125 | } 126 | 127 | void FeederClass::gotoRetractPosition() { 128 | this->servo.write(this->feederSettings.retract_angle); 129 | this->feederPosition=sAT_RETRACT_POSITION; 130 | this->feederState=sMOVING; 131 | #ifdef DEBUG 132 | Serial.println("going to retract now"); 133 | #endif 134 | } 135 | 136 | void FeederClass::gotoHalfAdvancedPosition() { 137 | this->servo.write(this->feederSettings.half_advanced_angle); 138 | this->feederPosition=sAT_HALF_ADVANCED_POSITION; 139 | this->feederState=sMOVING; 140 | #ifdef DEBUG 141 | Serial.println("going to half adv now"); 142 | #endif 143 | } 144 | 145 | void FeederClass::gotoFullAdvancedPosition() { 146 | this->servo.write(this->feederSettings.full_advanced_angle); 147 | this->feederPosition=sAT_FULL_ADVANCED_POSITION; 148 | this->feederState=sMOVING; 149 | #ifdef DEBUG 150 | Serial.println("going to full adv now"); 151 | #endif 152 | } 153 | 154 | 155 | void FeederClass::gotoAngle(uint8_t angle) { 156 | 157 | this->servo.write(angle); 158 | 159 | #ifdef DEBUG 160 | Serial.print("going to "); 161 | Serial.print(angle); 162 | Serial.println("deg"); 163 | #endif 164 | } 165 | 166 | bool FeederClass::advance(uint8_t feedLength, bool overrideError = false) { 167 | 168 | #ifdef DEBUG 169 | Serial.println(F("advance triggered")); 170 | Serial.println(this->reportFeederErrorState()); 171 | #endif 172 | 173 | 174 | #ifdef DEBUG 175 | Serial.print(F("feederIsOk: ")); 176 | Serial.println(this->feederIsOk()); 177 | Serial.print(F("overrideError: ")); 178 | Serial.println(overrideError); 179 | #endif 180 | 181 | //check whether feeder is OK before every advance command 182 | if( !this->feederIsOk() ) { 183 | //feeder is in error state, usually this would lead to exit advance with false and no advancing cycle started 184 | 185 | if(!overrideError) { 186 | //return with false means an error, that is not ignored/overridden 187 | //error, and error was not overridden -> return false, advance not successful 188 | return false; 189 | } else { 190 | #ifdef DEBUG 191 | Serial.println(F("overridden error temporarily")); 192 | #endif 193 | 194 | } 195 | } 196 | 197 | //check, what to do? if not, return quickly 198 | if(feedLength==0) { 199 | //nothing to do, just return 200 | #ifdef DEBUG 201 | Serial.println(F("advance ignored, 0 feedlength was given")); 202 | #endif 203 | } else if ( feedLength>0 && this->feederState!=sIDLE ) { 204 | //last advancing not completed! ignore newly received command 205 | //TODO: one could use a queue 206 | #ifdef DEBUG 207 | 208 | Serial.print(F("advance ignored, feedlength>0 given, but feederState!=sIDLE")); 209 | Serial.print(F(" (feederState=")); 210 | Serial.print(this->feederState); 211 | Serial.println(F(")")); 212 | #endif 213 | } else { 214 | //OK, start new advance-proc 215 | //feed multiples of 2 possible: 2/4/6/8/10/12,... 216 | #ifdef DEBUG 217 | Serial.print(F("advance initialized, remainingFeedLength=")); 218 | Serial.println(feedLength); 219 | #endif 220 | this->remainingFeedLength=feedLength; 221 | } 222 | 223 | //return true: advance started okay 224 | return true; 225 | } 226 | 227 | bool FeederClass::feederIsOk() { 228 | if(this->getFeederErrorState() == sERROR) { 229 | return false; 230 | } else { 231 | return true; 232 | } 233 | } 234 | 235 | FeederClass::tFeederErrorState FeederClass::getFeederErrorState() { 236 | #ifdef HAS_FEEDBACKLINES 237 | if(!this->hasFeedbackLine()) { 238 | //no feedback-line, return always OK 239 | //no feedback pin defined or feedback shall be ignored 240 | return sOK_NOFEEDBACKLINE; 241 | } 242 | 243 | if( digitalRead((uint8_t)feederFeedbackPinMap[this->feederNo]) == LOW ) { 244 | //the microswitch pulls feedback-pin LOW if tension of cover tape is OK. motor to pull tape is off then 245 | //no error 246 | return sOK; 247 | } else { 248 | //microswitch is not pushed down, this is considered as an error 249 | 250 | if(this->feederSettings.ignore_feedback==1) { 251 | //error present, but ignore 252 | return sERROR_IGNORED; 253 | } else { 254 | //error present, report fail 255 | return sERROR; 256 | } 257 | 258 | } 259 | #else 260 | return sOK_NOFEEDBACKLINE; 261 | #endif 262 | } 263 | 264 | String FeederClass::reportFeederErrorState() { 265 | switch(this->getFeederErrorState()) { 266 | case sOK_NOFEEDBACKLINE: 267 | return "getFeederErrorState: sOK_NOFEEDBACKLINE (no feedback line for feeder, impliciting feeder OK)"; 268 | break; 269 | case sOK: 270 | return "getFeederErrorState: sOK (feedbackline checked, explicit feeder OK)"; 271 | break; 272 | case sERROR_IGNORED: 273 | return "getFeederErrorState: sERROR_IGNORED (error, but ignored per feeder setting X1)"; 274 | break; 275 | case sERROR: 276 | return "getFeederErrorState: sERROR (error signaled on feedbackline)"; 277 | break; 278 | 279 | default: 280 | return "illegal state in reportFeederErrorState"; 281 | } 282 | } 283 | 284 | //called when M-Code to enable feeder is issued 285 | void FeederClass::enable() { 286 | 287 | this->feederState=sIDLE; 288 | 289 | } 290 | 291 | //called when M-Code to disable feeder is issued 292 | void FeederClass::disable() { 293 | 294 | this->feederState=sDISABLED; 295 | } 296 | 297 | void FeederClass::update() { 298 | 299 | #ifdef HAS_FEEDBACKLINES 300 | //routine for detecting manual feed via tensioner microswitch. 301 | //useful for setup a feeder. press tensioner short to advance by feeder's default feed length 302 | //feeder have to be enabled for this, otherwise this feature doesn't work and pressing the tensioner can't be detected due to open mosfet on controller pcb. 303 | if(this->feederState==sIDLE) { //only check feedback line if feeder is idle. this shall not interfere with the feedbackline-checking to detect the error state of the feeder 304 | 305 | if (millis() - this->lastTimeFeedbacklineCheck >= 10UL) { //to debounce, check every 10ms the feedbackline. 306 | 307 | this->lastTimeFeedbacklineCheck=millis(); //update last time checked 308 | 309 | int buttonState = digitalRead(feederFeedbackPinMap[this->feederNo]); //read level of feedbackline (active low) 310 | 311 | if ( this->feedbackLineTickCounter > 0 ) { //to debounce there is a timer 312 | this->feedbackLineTickCounter++; 313 | } 314 | 315 | 316 | if ( (buttonState != this->lastButtonState) && (buttonState == LOW)) { //event: button state changed to low (tensioner pressed) 317 | this->lastButtonState=buttonState; //update state 318 | this->feedbackLineTickCounter=1; //start counter 319 | #ifdef DEBUG 320 | Serial.println(F("buttonState changed to low")); 321 | #endif 322 | } else if (buttonState != this->lastButtonState) { 323 | this->lastButtonState=buttonState; //update in case button went high again 324 | } 325 | 326 | if ( (this->feedbackLineTickCounter > 5) ) { 327 | //after 50ms the microswitch is expected to be debounced, so a potential manual feed can be issued, when going to high level again. 328 | if(buttonState==HIGH) { 329 | //button released, we have a valid feed command now 330 | #ifdef DEBUG 331 | Serial.print(F("Manual feed triggered for feeder N")); 332 | Serial.print(this->feederNo); 333 | Serial.print(F(", advancing feeders default length ")); 334 | Serial.print(this->feederSettings.feed_length); 335 | Serial.println(F("mm.")); 336 | #endif 337 | 338 | //trigger feed with default feeder length, errors are overridden. 339 | this->advance(this->feederSettings.feed_length,true); 340 | 341 | //reset 342 | this->feedbackLineTickCounter=0; 343 | } 344 | 345 | //check for invalidity 346 | if (this->feedbackLineTickCounter > 50) { //button pressed too long (this is the case, too, if the cover tape was inserted and properly tensioned) 347 | 348 | #ifdef DEBUG 349 | Serial.println(F("Potential manual feed rejected (button pressed too long, probably cover tape was inserted properly)")); 350 | #endif 351 | 352 | //reset counter to reject potential feed 353 | this->feedbackLineTickCounter=0; 354 | } 355 | } 356 | } 357 | } else { 358 | //permanently reset vars to don't do anything if not idle... 359 | this->lastButtonState = digitalRead(feederFeedbackPinMap[this->feederNo]); //read level of feedbackline (active low) 360 | feedbackLineTickCounter=0; 361 | } 362 | 363 | #endif 364 | 365 | //state machine-update-stuff (for settle time) 366 | if(this->lastFeederPosition!=this->feederPosition) { 367 | this->lastTimePositionChange=millis(); 368 | this->lastFeederPosition=this->feederPosition; 369 | } 370 | 371 | //time to change the position? 372 | if (millis() - this->lastTimePositionChange >= (unsigned long)this->feederSettings.time_to_settle) { 373 | 374 | //now servo is expected to have settled at its designated position, so do some stuff 375 | if(this->feederState==sADVANCING_CYCLE_COMPLETED) { 376 | Serial.println("ok, advancing cycle completed"); 377 | this->feederState=sIDLE; 378 | } 379 | 380 | //if no need for feeding exit fast. 381 | if(this->remainingFeedLength==0) { 382 | 383 | if(this->feederState!=sDISABLED) 384 | //if feeder are not disabled: 385 | //make sure sIDLE is entered always again (needed if gotoXXXPosition functions are called directly instead by advance() which would set a remainingFeedLength) 386 | this->feederState=sIDLE; 387 | 388 | return; 389 | } else { 390 | this->feederState=sMOVING; 391 | } 392 | 393 | #ifdef DEBUG 394 | Serial.print("remainingFeedLength before working: "); 395 | Serial.println(this->remainingFeedLength); 396 | #endif 397 | switch (this->feederPosition) { 398 | /* ------------------------------------- RETRACT POS ---------------------- */ 399 | case sAT_RETRACT_POSITION: { 400 | if(this->remainingFeedLength>=FEEDER_MECHANICAL_ADVANCE_LENGTH) { 401 | //goto full advance-pos 402 | this->gotoFullAdvancedPosition(); 403 | this->remainingFeedLength-=FEEDER_MECHANICAL_ADVANCE_LENGTH; 404 | } else if(this->remainingFeedLength>=FEEDER_MECHANICAL_ADVANCE_LENGTH/2) { 405 | //goto half advance-pos 406 | this->gotoHalfAdvancedPosition(); 407 | this->remainingFeedLength-=FEEDER_MECHANICAL_ADVANCE_LENGTH/2; 408 | } 409 | 410 | } 411 | break; 412 | 413 | /* ------------------------------------- HALF-ADVANCED POS ---------------------- */ 414 | case sAT_HALF_ADVANCED_POSITION: { 415 | if(this->remainingFeedLength>=FEEDER_MECHANICAL_ADVANCE_LENGTH/2) { 416 | //goto full advance-pos 417 | this->gotoFullAdvancedPosition(); 418 | this->remainingFeedLength-=FEEDER_MECHANICAL_ADVANCE_LENGTH/2; 419 | } 420 | } 421 | break; 422 | 423 | /* ------------------------------------- FULL-ADVANCED POS ---------------------- */ 424 | case sAT_FULL_ADVANCED_POSITION: { 425 | // if coming here and remainingFeedLength==0, then the function is aborted above already, thus no retract after pick 426 | // if coming here and remainingFeedLength >0, then the feeder goes to retract for next advance move 427 | this->gotoRetractPosition(); 428 | } 429 | break; 430 | 431 | default: { 432 | //state not relevant for advancing... 433 | //return error, should not occur? 434 | } 435 | break; 436 | } 437 | 438 | #ifdef DEBUG 439 | Serial.print("remainingFeedLength after working: "); 440 | Serial.println(this->remainingFeedLength); 441 | #endif 442 | 443 | //just finished advancing? set flag to send ok in next run after settle-time to let the pnp go on 444 | if(this->remainingFeedLength==0) { 445 | this->feederState=sADVANCING_CYCLE_COMPLETED; 446 | } 447 | } 448 | 449 | 450 | 451 | return; 452 | } 453 | -------------------------------------------------------------------------------- /0816feeder.cppproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2.0 5 | 7.0 6 | com.Atmel.AVRGCC8.CPP 7 | {41d67b95-e04c-4f82-a6fa-5e5bd8099f3f} 8 | atmega2560 9 | none 10 | Executable 11 | CPP 12 | $(MSBuildProjectName) 13 | .elf 14 | $(MSBuildProjectDirectory)\$(Configuration) 15 | feeder_firmware_prototype 16 | 0816feeder 17 | feeder_firmware_prototype 18 | Native 19 | true 20 | false 21 | exception_table 22 | 0 23 | true 24 | 0x20000000 25 | true 26 | 27 | 0 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | true 41 | com.atmel.avrdbg.tool.atmelice 42 | J41800050422 43 | 0x1E950F 44 | 45 | 46 | 47 | 125000 48 | 49 | ISP 50 | 51 | com.atmel.avrdbg.tool.atmelice 52 | J41800050422 53 | Atmel-ICE 54 | 55 | ISP 56 | 125000 57 | 58 | 59 | 60 | 61 | True 62 | True 63 | True 64 | True 65 | False 66 | True 67 | True 68 | 69 | 70 | __AVR_ATmega2560__ 71 | _VMDEBUG=1 72 | ARDUINO=10801 73 | ARDUINO_MAIN 74 | F_CPU=16000000L 75 | __AVR__ 76 | ARDUINO_AVR_MEGA2560 77 | ARDUINO_ARCH_AVR 78 | 79 | 80 | 81 | 82 | C:/Users/buero/Documents/Arduino/libraries/EEPROMEx 83 | C:/Users/buero/Documents/Arduino/libraries/Servo/src 84 | C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/xmu4sem3.w5h/Micro Platforms/visualmicro/ide-atmel/libraries 85 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries 86 | C:/Users/buero/Documents/Arduino/libraries 87 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/cores/arduino 88 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/mega 89 | ../../../0816feeder 90 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/ 91 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/avr/ 92 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/lib/gcc/avr/4.8.1/include 93 | 94 | 95 | Optimize (-O1) 96 | True 97 | True 98 | Default (-g2) 99 | True 100 | True 101 | True 102 | 103 | 104 | __AVR_ATmega2560__ 105 | _VMDEBUG=1 106 | ARDUINO=10801 107 | ARDUINO_MAIN 108 | F_CPU=16000000L 109 | __AVR__ 110 | ARDUINO_AVR_MEGA2560 111 | ARDUINO_ARCH_AVR 112 | 113 | 114 | 115 | 116 | C:/Users/buero/Documents/Arduino/libraries/EEPROMEx 117 | C:/Users/buero/Documents/Arduino/libraries/Servo/src 118 | C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/xmu4sem3.w5h/Micro Platforms/visualmicro/ide-atmel/libraries 119 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries 120 | C:/Users/buero/Documents/Arduino/libraries 121 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/cores/arduino 122 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/mega 123 | ../../../0816feeder 124 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/ 125 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/avr/ 126 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/lib/gcc/avr/4.8.1/include 127 | 128 | 129 | Optimize (-O1) 130 | True 131 | True 132 | Default (-g2) 133 | True 134 | Default (-Wa,-g) 135 | 136 | 137 | C:/Users/buero/Documents/Arduino/libraries/Bounce2;C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/fqwf2rud.bni/Micro Platforms/visualmicro/ide-atmel/libraries;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries;C:/Users/buero/Documents/Arduino/libraries;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/cores/arduino;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/standard;../../../feeder_firmware_prototype;C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/;C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/avr/;C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/lib/gcc/avr/4.8.1/include;C:/Users/buero/Documents/Arduino/libraries/Servo/src;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries/SoftwareSerial/src;C:/Users/buero/Documents/Arduino/libraries/CmdMessenger;C:/Users/buero/Documents/Arduino/libraries/CmdMessenger/utility;C:/Users/buero/Documents/Arduino/libraries/EEPROMEx;C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/xmu4sem3.w5h/Micro Platforms/visualmicro/ide-atmel/libraries;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/mega;../../../0186feeder;../../../0816feeder; 138 | 139 | 140 | COM15 141 | 0 142 | atmel_studio_device_programming 143 | mega_atmega2560 144 | Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) 145 | name=Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) 146 | vid.0=0x2341 147 | pid.0=0x0010 148 | vid.1=0x2341 149 | pid.1=0x0042 150 | vid.2=0x2A03 151 | pid.2=0x0010 152 | vid.3=0x2A03 153 | pid.3=0x0042 154 | vid.4=0x2341 155 | pid.4=0x0210 156 | vid.5=0x2341 157 | pid.5=0x0242 158 | upload.tool=avrdude 159 | upload.maximum_data_size=8192 160 | bootloader.tool=avrdude 161 | bootloader.low_fuses=0xFF 162 | bootloader.unlock_bits=0x3F 163 | bootloader.lock_bits=0x0F 164 | build.f_cpu=16000000L 165 | build.core=arduino 166 | build.variant=mega 167 | build.board=AVR_MEGA2560 168 | menu.cpu.atmega2560=ATmega2560 (Mega 2560) 169 | menu.cpu.atmega2560.upload.protocol=wiring 170 | menu.cpu.atmega2560.upload.maximum_size=253952 171 | menu.cpu.atmega2560.upload.speed=115200 172 | menu.cpu.atmega2560.bootloader.high_fuses=0xD8 173 | menu.cpu.atmega2560.bootloader.extended_fuses=0xFD 174 | menu.cpu.atmega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex 175 | menu.cpu.atmega2560.build.mcu=atmega2560 176 | menu.cpu.atmega2560.build.board=AVR_MEGA2560 177 | menu.cpu.atmega1280=ATmega1280 178 | menu.cpu.atmega1280.upload.protocol=arduino 179 | menu.cpu.atmega1280.upload.maximum_size=126976 180 | menu.cpu.atmega1280.upload.speed=57600 181 | menu.cpu.atmega1280.bootloader.high_fuses=0xDA 182 | menu.cpu.atmega1280.bootloader.extended_fuses=0xF5 183 | menu.cpu.atmega1280.bootloader.file=atmega/ATmegaBOOT_168_atmega1280.hex 184 | menu.cpu.atmega1280.build.mcu=atmega1280 185 | menu.cpu.atmega1280.build.board=AVR_MEGA 186 | runtime.ide.path=C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\xmu4sem3.w5h\Micro Platforms\visualmicro\ide-atmel 187 | runtime.os=windows 188 | build.system.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17\system 189 | runtime.ide.version=10801 190 | target_package=arduino 191 | target_platform=avr 192 | runtime.hardware.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr 193 | originalid=mega 194 | intellisense.tools.path={runtime.tools.avr-gcc.path}\ 195 | intellisense.include.paths={intellisense.tools.path}avr\include\;{intellisense.tools.path}avr\include\avr\;{intellisense.tools.path}lib\gcc\avr\4.8.1\include 196 | tools.atprogram.cmd.path=%AVRSTUDIO_EXE_PATH%\atbackend\atprogram 197 | tools.atprogram.cmd.setwinpath=true 198 | tools.atprogram.program.params.verbose=-v 199 | tools.atprogram.program.params.quiet=-q 200 | tools.atprogram.program.pattern="{cmd.path}" -d {build.mcu} {program.verbose} {program.extra_params} program -c -f "{build.path}\{build.project_name}.hex" 201 | tools.atprogram.program.xpattern="{cmd.path}" {AVRSTUDIO_BACKEND_CONNECTION} -d {build.mcu} {program.verbose} {program.extra_params} program -c -f "{build.path}\{build.project_name}.hex" 202 | tools.atprogram.erase.params.verbose=-v 203 | tools.atprogram.erase.params.quiet=-q 204 | tools.atprogram.bootloader.params.verbose=-v 205 | tools.atprogram.bootloader.params.quiet=-q 206 | tools.atprogram.bootloader.pattern="{cmd.path}" -d {build.mcu} {bootloader.verbose} program -c -f "{runtime.ide.path}\hardware\arduino\avr\bootloaders\{bootloader.file}" 207 | version=1.6.17 208 | compiler.warning_flags=-w 209 | compiler.warning_flags.none=-w 210 | compiler.warning_flags.default= 211 | compiler.warning_flags.more=-Wall 212 | compiler.warning_flags.all=-Wall -Wextra 213 | compiler.path={runtime.tools.avr-gcc.path}/bin/ 214 | compiler.c.cmd=avr-gcc 215 | compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects 216 | compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections 217 | compiler.c.elf.cmd=avr-gcc 218 | compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD 219 | compiler.cpp.cmd=avr-g++ 220 | compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto 221 | compiler.ar.cmd=avr-gcc-ar 222 | compiler.ar.flags=rcs 223 | compiler.objcopy.cmd=avr-objcopy 224 | compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 225 | compiler.elf2hex.flags=-O ihex -R .eeprom 226 | compiler.elf2hex.cmd=avr-objcopy 227 | compiler.ldflags= 228 | compiler.size.cmd=avr-size 229 | build.extra_flags= 230 | compiler.c.extra_flags= 231 | compiler.c.elf.extra_flags= 232 | compiler.S.extra_flags= 233 | compiler.cpp.extra_flags= 234 | compiler.ar.extra_flags= 235 | compiler.objcopy.eep.extra_flags= 236 | compiler.elf2hex.extra_flags= 237 | recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 238 | recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 239 | recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 240 | archive_file_path={build.path}/{archive_file} 241 | recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" 242 | recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm 243 | recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep" 244 | recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" 245 | recipe.output.tmp_file={build.project_name}.hex 246 | recipe.output.save_file={build.project_name}.{build.variant}.hex 247 | recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" 248 | recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* 249 | recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* 250 | recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* 251 | preproc.includes.flags=-w -x c++ -M -MG -MP 252 | recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" 253 | preproc.macros.flags=-w -x c++ -E -CC 254 | recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}" 255 | tools.avrdude.path={runtime.tools.avrdude.path} 256 | tools.avrdude.cmd.path={path}/bin/avrdude 257 | tools.avrdude.config.path={path}/etc/avrdude.conf 258 | tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA 259 | tools.avrdude.upload.params.verbose=-v 260 | tools.avrdude.upload.params.quiet=-q -q 261 | tools.avrdude.upload.verify= 262 | tools.avrdude.upload.params.noverify=-V 263 | tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" 264 | tools.avrdude.program.params.verbose=-v 265 | tools.avrdude.program.params.quiet=-q -q 266 | tools.avrdude.program.verify= 267 | tools.avrdude.program.params.noverify=-V 268 | tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" 269 | tools.avrdude.erase.params.verbose=-v 270 | tools.avrdude.erase.params.quiet=-q -q 271 | tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m 272 | tools.avrdude.bootloader.params.verbose=-v 273 | tools.avrdude.bootloader.params.quiet=-q -q 274 | tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m 275 | tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} 276 | tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} 277 | build.usb_manufacturer="Unknown" 278 | build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' 279 | vm.platform.root.path=C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\xmu4sem3.w5h\Micro Platforms\arduino16x 280 | avrisp.name=AVR ISP 281 | avrisp.communication=serial 282 | avrisp.protocol=stk500v1 283 | avrisp.program.protocol=stk500v1 284 | avrisp.program.tool=avrdude 285 | avrisp.program.extra_params=-P{serial.port} 286 | avrispmkii.name=AVRISP mkII 287 | avrispmkii.communication=usb 288 | avrispmkii.protocol=stk500v2 289 | avrispmkii.program.protocol=stk500v2 290 | avrispmkii.program.tool=avrdude 291 | avrispmkii.program.extra_params=-Pusb 292 | usbtinyisp.name=USBtinyISP 293 | usbtinyisp.protocol=usbtiny 294 | usbtinyisp.program.tool=avrdude 295 | usbtinyisp.program.extra_params= 296 | arduinoisp.name=ArduinoISP 297 | arduinoisp.protocol=arduinoisp 298 | arduinoisp.program.tool=avrdude 299 | arduinoisp.program.extra_params= 300 | arduinoisporg.name=ArduinoISP.org 301 | arduinoisporg.protocol=arduinoisporg 302 | arduinoisporg.program.tool=avrdude 303 | arduinoisporg.program.extra_params= 304 | usbasp.name=USBasp 305 | usbasp.communication=usb 306 | usbasp.protocol=usbasp 307 | usbasp.program.protocol=usbasp 308 | usbasp.program.tool=avrdude 309 | usbasp.program.extra_params=-Pusb 310 | parallel.name=Parallel Programmer 311 | parallel.protocol=dapa 312 | parallel.force=true 313 | parallel.program.tool=avrdude 314 | parallel.program.extra_params=-F 315 | arduinoasisp.name=Arduino as ISP 316 | arduinoasisp.communication=serial 317 | arduinoasisp.protocol=stk500v1 318 | arduinoasisp.speed=19200 319 | arduinoasisp.program.protocol=stk500v1 320 | arduinoasisp.program.speed=19200 321 | arduinoasisp.program.tool=avrdude 322 | arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed} 323 | usbGemma.name=Arduino Gemma 324 | usbGemma.protocol=arduinogemma 325 | usbGemma.program.tool=avrdude 326 | usbGemma.program.extra_params= 327 | usbGemma.config.path={runtime.platform.path}/bootloaders/gemma/avrdude.conf 328 | stk500.name=Atmel STK500 development board 329 | stk500.communication=serial 330 | stk500.protocol=stk500 331 | stk500.program.protocol=stk500 332 | stk500.program.tool=avrdude 333 | stk500.program.extra_params=-P{serial.port} 334 | buspirate.name=BusPirate as ISP 335 | buspirate.communication=serial 336 | buspirate.protocol=buspirate 337 | buspirate.program.protocol=buspirate 338 | buspirate.program.tool=avrdude 339 | buspirate.program.extra_params=-P{serial.port} 340 | runtime.tools.avr-gcc.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 341 | runtime.tools.avr-gcc-4.9.2-atmel3.5.3-arduino2.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 342 | runtime.tools.avrdude.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8 343 | runtime.tools.avrdude-6.3.0-arduino8.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8 344 | runtime.tools.arduinoOTA.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\arduinoOTA\1.0.0 345 | runtime.tools.arduinoOTA-1.0.0.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\arduinoOTA\1.0.0 346 | upload.protocol=wiring 347 | upload.maximum_size=253952 348 | upload.speed=115200 349 | bootloader.high_fuses=0xD8 350 | bootloader.extended_fuses=0xFD 351 | bootloader.file=stk500v2/stk500boot_v2_mega2560.hex 352 | build.mcu=atmega2560 353 | runtime.vm.boardinfo.id=mega_atmega2560 354 | runtime.vm.boardinfo.name=mega_atmega2560 355 | runtime.vm.boardinfo.desc=Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) 356 | runtime.vm.boardinfo.src_location=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17 357 | ide.hint=Ready-To-Go IDE: Use the Board and Library managers to install. 358 | ide.location.key=visualmicro 359 | ide.location.ide.auto=true 360 | ide.location.ide.winreg=Arduino Default Application 361 | ide.location.sketchbook.winreg=Arduino Default Sketchbook 362 | ide.location.sketchbook.preferences=sketchbook.path 363 | ide.default.revision_name=1.8.1 364 | ide.default.version=10801 365 | ide.platforms.basedon=arduino16x 366 | ide.default.package=arduino 367 | ide.default.platform=avr 368 | ide.multiplatform=true 369 | ide.includes=arduino.h 370 | ide.exe_name=arduino 371 | ide.platformswithoutpackage=false 372 | ide.includes.fallback=wprogram.h 373 | ide.extension=ino 374 | ide.extension.fallback=pde 375 | ide.versionGTEQ=160 376 | ide.hosts=atmel 377 | vm.debug=true 378 | software=ARDUINO 379 | ssh.user.name=root 380 | ssh.user.default.password=arduino 381 | ssh.host.wwwfiles.path=/www/sd 382 | ide.location.preferences.arduinoData={runtime.sketchbook.path}\ArduinoData 383 | ide.location.preferences=%VM_APPDATA_LOCAL%\arduino15\preferences.txt 384 | ide.location.preferences_fallback=%VM_APPDATA_ROAMING%\arduino15\preferences.txt 385 | ide.location.contributions=%VM_APPDATA_LOCAL%\arduino15 386 | ide.location.contributions_fallback=%VM_APPDATA_ROAMING%\arduino15 387 | ide.contributions.boards.allow=true 388 | ide.contributions.boards.ignore_unless_rewrite_found=true 389 | ide.contributions.libraries.allow=true 390 | ide.contributions.boards.support.urls.wiki=https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls 391 | ide.create_platforms_from_boardsTXT.teensy=build.core 392 | ide.appid=visualmicro 393 | location.sketchbook=C:\Users\buero\Documents\Arduino 394 | build.core.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17\cores\arduino 395 | vm.core.include=arduino.h 396 | vm.boardsource.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17 397 | runtime.platform.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17 398 | vm.platformname.name=avr 399 | build.arch=AVR 400 | 401 | atmega2560 402 | 16000000L 403 | arduino 404 | wiring 405 | 115200 406 | 253952 407 | visualmicro 408 | arduino 409 | avr 410 | 411 | 412 | 413 | 414 | 415 | 416 | True 417 | True 418 | True 419 | True 420 | False 421 | True 422 | True 423 | 424 | 425 | __AVR_ATmega2560__ 426 | _VMDEBUG=1 427 | ARDUINO=10801 428 | ARDUINO_MAIN 429 | F_CPU=16000000L 430 | __AVR__ 431 | ARDUINO_AVR_MEGA2560 432 | ARDUINO_ARCH_AVR 433 | 434 | 435 | 436 | 437 | C:/Users/buero/Documents/Arduino/libraries/EEPROMEx 438 | C:/Users/buero/Documents/Arduino/libraries/Servo/src 439 | C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/xmu4sem3.w5h/Micro Platforms/visualmicro/ide-atmel/libraries 440 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries 441 | C:/Users/buero/Documents/Arduino/libraries 442 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/cores/arduino 443 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/mega 444 | ../../../0816feeder 445 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/ 446 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/avr/ 447 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/lib/gcc/avr/4.8.1/include 448 | 449 | 450 | Optimize (-O1) 451 | True 452 | True 453 | Default (-g2) 454 | True 455 | True 456 | True 457 | 458 | 459 | __AVR_ATmega2560__ 460 | _VMDEBUG=1 461 | ARDUINO=10801 462 | ARDUINO_MAIN 463 | F_CPU=16000000L 464 | __AVR__ 465 | ARDUINO_AVR_MEGA2560 466 | ARDUINO_ARCH_AVR 467 | 468 | 469 | 470 | 471 | C:/Users/buero/Documents/Arduino/libraries/EEPROMEx 472 | C:/Users/buero/Documents/Arduino/libraries/Servo/src 473 | C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/xmu4sem3.w5h/Micro Platforms/visualmicro/ide-atmel/libraries 474 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries 475 | C:/Users/buero/Documents/Arduino/libraries 476 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/cores/arduino 477 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/mega 478 | ../../../0816feeder 479 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/ 480 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/avr/ 481 | C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/lib/gcc/avr/4.8.1/include 482 | 483 | 484 | Optimize (-O1) 485 | True 486 | True 487 | Default (-g2) 488 | True 489 | Default (-Wa,-g) 490 | 491 | 492 | C:/Users/buero/Documents/Arduino/libraries/Bounce2;C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/fqwf2rud.bni/Micro Platforms/visualmicro/ide-atmel/libraries;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries;C:/Users/buero/Documents/Arduino/libraries;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/cores/arduino;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/standard;../../../feeder_firmware_prototype;C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/;C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/avr/include/avr/;C:/Users/buero/AppData/Local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/lib/gcc/avr/4.8.1/include;C:/Users/buero/Documents/Arduino/libraries/Servo/src;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/libraries/SoftwareSerial/src;C:/Users/buero/Documents/Arduino/libraries/CmdMessenger;C:/Users/buero/Documents/Arduino/libraries/CmdMessenger/utility;C:/Users/buero/Documents/Arduino/libraries/EEPROMEx;C:/Program Files (x86)/Atmel/Studio/7.0/Extensions/xmu4sem3.w5h/Micro Platforms/visualmicro/ide-atmel/libraries;C:/Users/buero/AppData/Local/arduino15/packages/arduino/hardware/avr/1.6.17/variants/mega;../../../0186feeder;../../../0816feeder; 493 | 494 | 495 | COM15 496 | 0 497 | atmel_studio_device_programming 498 | mega_atmega2560 499 | Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) 500 | name=Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) 501 | vid.0=0x2341 502 | pid.0=0x0010 503 | vid.1=0x2341 504 | pid.1=0x0042 505 | vid.2=0x2A03 506 | pid.2=0x0010 507 | vid.3=0x2A03 508 | pid.3=0x0042 509 | vid.4=0x2341 510 | pid.4=0x0210 511 | vid.5=0x2341 512 | pid.5=0x0242 513 | upload.tool=avrdude 514 | upload.maximum_data_size=8192 515 | bootloader.tool=avrdude 516 | bootloader.low_fuses=0xFF 517 | bootloader.unlock_bits=0x3F 518 | bootloader.lock_bits=0x0F 519 | build.f_cpu=16000000L 520 | build.core=arduino 521 | build.variant=mega 522 | build.board=AVR_MEGA2560 523 | menu.cpu.atmega2560=ATmega2560 (Mega 2560) 524 | menu.cpu.atmega2560.upload.protocol=wiring 525 | menu.cpu.atmega2560.upload.maximum_size=253952 526 | menu.cpu.atmega2560.upload.speed=115200 527 | menu.cpu.atmega2560.bootloader.high_fuses=0xD8 528 | menu.cpu.atmega2560.bootloader.extended_fuses=0xFD 529 | menu.cpu.atmega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex 530 | menu.cpu.atmega2560.build.mcu=atmega2560 531 | menu.cpu.atmega2560.build.board=AVR_MEGA2560 532 | menu.cpu.atmega1280=ATmega1280 533 | menu.cpu.atmega1280.upload.protocol=arduino 534 | menu.cpu.atmega1280.upload.maximum_size=126976 535 | menu.cpu.atmega1280.upload.speed=57600 536 | menu.cpu.atmega1280.bootloader.high_fuses=0xDA 537 | menu.cpu.atmega1280.bootloader.extended_fuses=0xF5 538 | menu.cpu.atmega1280.bootloader.file=atmega/ATmegaBOOT_168_atmega1280.hex 539 | menu.cpu.atmega1280.build.mcu=atmega1280 540 | menu.cpu.atmega1280.build.board=AVR_MEGA 541 | runtime.ide.path=C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\xmu4sem3.w5h\Micro Platforms\visualmicro\ide-atmel 542 | runtime.os=windows 543 | build.system.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17\system 544 | runtime.ide.version=10801 545 | target_package=arduino 546 | target_platform=avr 547 | runtime.hardware.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr 548 | originalid=mega 549 | intellisense.tools.path={runtime.tools.avr-gcc.path}\ 550 | intellisense.include.paths={intellisense.tools.path}avr\include\;{intellisense.tools.path}avr\include\avr\;{intellisense.tools.path}lib\gcc\avr\4.8.1\include 551 | tools.atprogram.cmd.path=%AVRSTUDIO_EXE_PATH%\atbackend\atprogram 552 | tools.atprogram.cmd.setwinpath=true 553 | tools.atprogram.program.params.verbose=-v 554 | tools.atprogram.program.params.quiet=-q 555 | tools.atprogram.program.pattern="{cmd.path}" -d {build.mcu} {program.verbose} {program.extra_params} program -c -f "{build.path}\{build.project_name}.hex" 556 | tools.atprogram.program.xpattern="{cmd.path}" {AVRSTUDIO_BACKEND_CONNECTION} -d {build.mcu} {program.verbose} {program.extra_params} program -c -f "{build.path}\{build.project_name}.hex" 557 | tools.atprogram.erase.params.verbose=-v 558 | tools.atprogram.erase.params.quiet=-q 559 | tools.atprogram.bootloader.params.verbose=-v 560 | tools.atprogram.bootloader.params.quiet=-q 561 | tools.atprogram.bootloader.pattern="{cmd.path}" -d {build.mcu} {bootloader.verbose} program -c -f "{runtime.ide.path}\hardware\arduino\avr\bootloaders\{bootloader.file}" 562 | version=1.6.17 563 | compiler.warning_flags=-w 564 | compiler.warning_flags.none=-w 565 | compiler.warning_flags.default= 566 | compiler.warning_flags.more=-Wall 567 | compiler.warning_flags.all=-Wall -Wextra 568 | compiler.path={runtime.tools.avr-gcc.path}/bin/ 569 | compiler.c.cmd=avr-gcc 570 | compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects 571 | compiler.c.elf.flags={compiler.warning_flags} -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections 572 | compiler.c.elf.cmd=avr-gcc 573 | compiler.S.flags=-c -g -x assembler-with-cpp -flto -MMD 574 | compiler.cpp.cmd=avr-g++ 575 | compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto 576 | compiler.ar.cmd=avr-gcc-ar 577 | compiler.ar.flags=rcs 578 | compiler.objcopy.cmd=avr-objcopy 579 | compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 580 | compiler.elf2hex.flags=-O ihex -R .eeprom 581 | compiler.elf2hex.cmd=avr-objcopy 582 | compiler.ldflags= 583 | compiler.size.cmd=avr-size 584 | build.extra_flags= 585 | compiler.c.extra_flags= 586 | compiler.c.elf.extra_flags= 587 | compiler.S.extra_flags= 588 | compiler.cpp.extra_flags= 589 | compiler.ar.extra_flags= 590 | compiler.objcopy.eep.extra_flags= 591 | compiler.elf2hex.extra_flags= 592 | recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 593 | recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 594 | recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" 595 | archive_file_path={build.path}/{archive_file} 596 | recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" 597 | recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm 598 | recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep" 599 | recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" 600 | recipe.output.tmp_file={build.project_name}.hex 601 | recipe.output.save_file={build.project_name}.{build.variant}.hex 602 | recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" 603 | recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).* 604 | recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* 605 | recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* 606 | preproc.includes.flags=-w -x c++ -M -MG -MP 607 | recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.includes.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" 608 | preproc.macros.flags=-w -x c++ -E -CC 609 | recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}" 610 | tools.avrdude.path={runtime.tools.avrdude.path} 611 | tools.avrdude.cmd.path={path}/bin/avrdude 612 | tools.avrdude.config.path={path}/etc/avrdude.conf 613 | tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA 614 | tools.avrdude.upload.params.verbose=-v 615 | tools.avrdude.upload.params.quiet=-q -q 616 | tools.avrdude.upload.verify= 617 | tools.avrdude.upload.params.noverify=-V 618 | tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} {upload.verify} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i" 619 | tools.avrdude.program.params.verbose=-v 620 | tools.avrdude.program.params.quiet=-q -q 621 | tools.avrdude.program.verify= 622 | tools.avrdude.program.params.noverify=-V 623 | tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i" 624 | tools.avrdude.erase.params.verbose=-v 625 | tools.avrdude.erase.params.quiet=-q -q 626 | tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m 627 | tools.avrdude.bootloader.params.verbose=-v 628 | tools.avrdude.bootloader.params.quiet=-q -q 629 | tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m 630 | tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} 631 | tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} 632 | build.usb_manufacturer="Unknown" 633 | build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' 634 | vm.platform.root.path=C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\xmu4sem3.w5h\Micro Platforms\arduino16x 635 | avrisp.name=AVR ISP 636 | avrisp.communication=serial 637 | avrisp.protocol=stk500v1 638 | avrisp.program.protocol=stk500v1 639 | avrisp.program.tool=avrdude 640 | avrisp.program.extra_params=-P{serial.port} 641 | avrispmkii.name=AVRISP mkII 642 | avrispmkii.communication=usb 643 | avrispmkii.protocol=stk500v2 644 | avrispmkii.program.protocol=stk500v2 645 | avrispmkii.program.tool=avrdude 646 | avrispmkii.program.extra_params=-Pusb 647 | usbtinyisp.name=USBtinyISP 648 | usbtinyisp.protocol=usbtiny 649 | usbtinyisp.program.tool=avrdude 650 | usbtinyisp.program.extra_params= 651 | arduinoisp.name=ArduinoISP 652 | arduinoisp.protocol=arduinoisp 653 | arduinoisp.program.tool=avrdude 654 | arduinoisp.program.extra_params= 655 | arduinoisporg.name=ArduinoISP.org 656 | arduinoisporg.protocol=arduinoisporg 657 | arduinoisporg.program.tool=avrdude 658 | arduinoisporg.program.extra_params= 659 | usbasp.name=USBasp 660 | usbasp.communication=usb 661 | usbasp.protocol=usbasp 662 | usbasp.program.protocol=usbasp 663 | usbasp.program.tool=avrdude 664 | usbasp.program.extra_params=-Pusb 665 | parallel.name=Parallel Programmer 666 | parallel.protocol=dapa 667 | parallel.force=true 668 | parallel.program.tool=avrdude 669 | parallel.program.extra_params=-F 670 | arduinoasisp.name=Arduino as ISP 671 | arduinoasisp.communication=serial 672 | arduinoasisp.protocol=stk500v1 673 | arduinoasisp.speed=19200 674 | arduinoasisp.program.protocol=stk500v1 675 | arduinoasisp.program.speed=19200 676 | arduinoasisp.program.tool=avrdude 677 | arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed} 678 | usbGemma.name=Arduino Gemma 679 | usbGemma.protocol=arduinogemma 680 | usbGemma.program.tool=avrdude 681 | usbGemma.program.extra_params= 682 | usbGemma.config.path={runtime.platform.path}/bootloaders/gemma/avrdude.conf 683 | stk500.name=Atmel STK500 development board 684 | stk500.communication=serial 685 | stk500.protocol=stk500 686 | stk500.program.protocol=stk500 687 | stk500.program.tool=avrdude 688 | stk500.program.extra_params=-P{serial.port} 689 | buspirate.name=BusPirate as ISP 690 | buspirate.communication=serial 691 | buspirate.protocol=buspirate 692 | buspirate.program.protocol=buspirate 693 | buspirate.program.tool=avrdude 694 | buspirate.program.extra_params=-P{serial.port} 695 | runtime.tools.avr-gcc.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 696 | runtime.tools.avr-gcc-4.9.2-atmel3.5.3-arduino2.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 697 | runtime.tools.avrdude.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8 698 | runtime.tools.avrdude-6.3.0-arduino8.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8 699 | runtime.tools.arduinoOTA.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\arduinoOTA\1.0.0 700 | runtime.tools.arduinoOTA-1.0.0.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\tools\arduinoOTA\1.0.0 701 | upload.protocol=wiring 702 | upload.maximum_size=253952 703 | upload.speed=115200 704 | bootloader.high_fuses=0xD8 705 | bootloader.extended_fuses=0xFD 706 | bootloader.file=stk500v2/stk500boot_v2_mega2560.hex 707 | build.mcu=atmega2560 708 | runtime.vm.boardinfo.id=mega_atmega2560 709 | runtime.vm.boardinfo.name=mega_atmega2560 710 | runtime.vm.boardinfo.desc=Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) 711 | runtime.vm.boardinfo.src_location=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17 712 | ide.hint=Ready-To-Go IDE: Use the Board and Library managers to install. 713 | ide.location.key=visualmicro 714 | ide.location.ide.auto=true 715 | ide.location.ide.winreg=Arduino Default Application 716 | ide.location.sketchbook.winreg=Arduino Default Sketchbook 717 | ide.location.sketchbook.preferences=sketchbook.path 718 | ide.default.revision_name=1.8.1 719 | ide.default.version=10801 720 | ide.platforms.basedon=arduino16x 721 | ide.default.package=arduino 722 | ide.default.platform=avr 723 | ide.multiplatform=true 724 | ide.includes=arduino.h 725 | ide.exe_name=arduino 726 | ide.platformswithoutpackage=false 727 | ide.includes.fallback=wprogram.h 728 | ide.extension=ino 729 | ide.extension.fallback=pde 730 | ide.versionGTEQ=160 731 | ide.hosts=atmel 732 | vm.debug=true 733 | software=ARDUINO 734 | ssh.user.name=root 735 | ssh.user.default.password=arduino 736 | ssh.host.wwwfiles.path=/www/sd 737 | ide.location.preferences.arduinoData={runtime.sketchbook.path}\ArduinoData 738 | ide.location.preferences=%VM_APPDATA_LOCAL%\arduino15\preferences.txt 739 | ide.location.preferences_fallback=%VM_APPDATA_ROAMING%\arduino15\preferences.txt 740 | ide.location.contributions=%VM_APPDATA_LOCAL%\arduino15 741 | ide.location.contributions_fallback=%VM_APPDATA_ROAMING%\arduino15 742 | ide.contributions.boards.allow=true 743 | ide.contributions.boards.ignore_unless_rewrite_found=true 744 | ide.contributions.libraries.allow=true 745 | ide.contributions.boards.support.urls.wiki=https://github.com/arduino/Arduino/wiki/Unofficial-list-of-3rd-party-boards-support-urls 746 | ide.create_platforms_from_boardsTXT.teensy=build.core 747 | ide.appid=visualmicro 748 | location.sketchbook=C:\Users\buero\Documents\Arduino 749 | build.core.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17\cores\arduino 750 | vm.core.include=arduino.h 751 | vm.boardsource.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17 752 | runtime.platform.path=C:\Users\buero\AppData\Local\arduino15\packages\arduino\hardware\avr\1.6.17 753 | vm.platformname.name=avr 754 | build.arch=AVR 755 | 756 | atmega2560 757 | 16000000L 758 | arduino 759 | wiring 760 | 115200 761 | 253952 762 | visualmicro 763 | arduino 764 | avr 765 | 766 | 767 | 768 | 769 | 770 | compile 771 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Bounce2\INSTALL.txt 772 | 773 | 774 | compile 775 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Bounce2\keywords.txt 776 | 777 | 778 | compile 779 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Bounce2\library.json 780 | 781 | 782 | compile 783 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Bounce2\library.properties 784 | 785 | 786 | compile 787 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\EEPROMEx\keywords.txt 788 | 789 | 790 | compile 791 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\EEPROMEx\library.json 792 | 793 | 794 | compile 795 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\EEPROMEx\library.properties 796 | 797 | 798 | compile 799 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\keywords.txt 800 | 801 | 802 | compile 803 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\library.properties 804 | 805 | 806 | compile 807 | 808 | 809 | compile 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | compile 843 | feeder_firmware_prototype\src\_micro-api-readonly\core\abi.cpp 844 | 845 | 846 | compile 847 | feeder_firmware_prototype\src\_micro-api-readonly\core\Arduino.h 848 | 849 | 850 | compile 851 | feeder_firmware_prototype\src\_micro-api-readonly\core\binary.h 852 | 853 | 854 | compile 855 | feeder_firmware_prototype\src\_micro-api-readonly\core\CDC.cpp 856 | 857 | 858 | compile 859 | feeder_firmware_prototype\src\_micro-api-readonly\core\Client.h 860 | 861 | 862 | compile 863 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial.cpp 864 | 865 | 866 | compile 867 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial.h 868 | 869 | 870 | compile 871 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial0.cpp 872 | 873 | 874 | compile 875 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial1.cpp 876 | 877 | 878 | compile 879 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial2.cpp 880 | 881 | 882 | compile 883 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial3.cpp 884 | 885 | 886 | compile 887 | feeder_firmware_prototype\src\_micro-api-readonly\core\HardwareSerial_private.h 888 | 889 | 890 | compile 891 | feeder_firmware_prototype\src\_micro-api-readonly\core\hooks.c 892 | 893 | 894 | compile 895 | feeder_firmware_prototype\src\_micro-api-readonly\core\IPAddress.cpp 896 | 897 | 898 | compile 899 | feeder_firmware_prototype\src\_micro-api-readonly\core\IPAddress.h 900 | 901 | 902 | compile 903 | feeder_firmware_prototype\src\_micro-api-readonly\core\main.cpp 904 | 905 | 906 | compile 907 | feeder_firmware_prototype\src\_micro-api-readonly\core\new.cpp 908 | 909 | 910 | compile 911 | feeder_firmware_prototype\src\_micro-api-readonly\core\new.h 912 | 913 | 914 | compile 915 | feeder_firmware_prototype\src\_micro-api-readonly\core\PluggableUSB.cpp 916 | 917 | 918 | compile 919 | feeder_firmware_prototype\src\_micro-api-readonly\core\PluggableUSB.h 920 | 921 | 922 | compile 923 | feeder_firmware_prototype\src\_micro-api-readonly\core\Print.cpp 924 | 925 | 926 | compile 927 | feeder_firmware_prototype\src\_micro-api-readonly\core\Print.h 928 | 929 | 930 | compile 931 | feeder_firmware_prototype\src\_micro-api-readonly\core\Printable.h 932 | 933 | 934 | compile 935 | feeder_firmware_prototype\src\_micro-api-readonly\core\Server.h 936 | 937 | 938 | compile 939 | feeder_firmware_prototype\src\_micro-api-readonly\core\Stream.cpp 940 | 941 | 942 | compile 943 | feeder_firmware_prototype\src\_micro-api-readonly\core\Stream.h 944 | 945 | 946 | compile 947 | feeder_firmware_prototype\src\_micro-api-readonly\core\Tone.cpp 948 | 949 | 950 | compile 951 | feeder_firmware_prototype\src\_micro-api-readonly\core\Udp.h 952 | 953 | 954 | compile 955 | feeder_firmware_prototype\src\_micro-api-readonly\core\USBAPI.h 956 | 957 | 958 | compile 959 | feeder_firmware_prototype\src\_micro-api-readonly\core\USBCore.cpp 960 | 961 | 962 | compile 963 | feeder_firmware_prototype\src\_micro-api-readonly\core\USBCore.h 964 | 965 | 966 | compile 967 | feeder_firmware_prototype\src\_micro-api-readonly\core\USBDesc.h 968 | 969 | 970 | compile 971 | feeder_firmware_prototype\src\_micro-api-readonly\core\WCharacter.h 972 | 973 | 974 | compile 975 | feeder_firmware_prototype\src\_micro-api-readonly\core\WInterrupts.c 976 | 977 | 978 | compile 979 | feeder_firmware_prototype\src\_micro-api-readonly\core\wiring.c 980 | 981 | 982 | compile 983 | feeder_firmware_prototype\src\_micro-api-readonly\core\wiring_analog.c 984 | 985 | 986 | compile 987 | feeder_firmware_prototype\src\_micro-api-readonly\core\wiring_digital.c 988 | 989 | 990 | compile 991 | feeder_firmware_prototype\src\_micro-api-readonly\core\wiring_private.h 992 | 993 | 994 | compile 995 | feeder_firmware_prototype\src\_micro-api-readonly\core\wiring_pulse.c 996 | 997 | 998 | compile 999 | feeder_firmware_prototype\src\_micro-api-readonly\core\wiring_shift.c 1000 | 1001 | 1002 | compile 1003 | feeder_firmware_prototype\src\_micro-api-readonly\core\WMath.cpp 1004 | 1005 | 1006 | compile 1007 | feeder_firmware_prototype\src\_micro-api-readonly\core\WString.cpp 1008 | 1009 | 1010 | compile 1011 | feeder_firmware_prototype\src\_micro-api-readonly\core\WString.h 1012 | 1013 | 1014 | compile 1015 | feeder_firmware_prototype\src\_micro-api-readonly\variants\mega\pins_arduino.h 1016 | 1017 | 1018 | compile 1019 | feeder_firmware_prototype\src\_micro-api-readonly\variants\standard\pins_arduino.h 1020 | 1021 | 1022 | compile 1023 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Bounce2\Bounce2.cpp 1024 | 1025 | 1026 | compile 1027 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Bounce2\Bounce2.h 1028 | 1029 | 1030 | compile 1031 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\EEPROMEx\EEPROMex.cpp 1032 | 1033 | 1034 | compile 1035 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\EEPROMEx\EEPROMex.h 1036 | 1037 | 1038 | compile 1039 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\EEPROMEx\EEPROMVar.h 1040 | 1041 | 1042 | compile 1043 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\avr\Servo.cpp 1044 | 1045 | 1046 | compile 1047 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\avr\ServoTimers.h 1048 | 1049 | 1050 | compile 1051 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\nrf52\Servo.cpp 1052 | 1053 | 1054 | compile 1055 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\nrf52\ServoTimers.h 1056 | 1057 | 1058 | compile 1059 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\samd\Servo.cpp 1060 | 1061 | 1062 | compile 1063 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\samd\ServoTimers.h 1064 | 1065 | 1066 | compile 1067 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\sam\Servo.cpp 1068 | 1069 | 1070 | compile 1071 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\sam\ServoTimers.h 1072 | 1073 | 1074 | compile 1075 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\Servo.h 1076 | 1077 | 1078 | compile 1079 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\stm32f4\Servo.cpp 1080 | 1081 | 1082 | compile 1083 | feeder_firmware_prototype\src\_micro-api-readonly\libraries\Servo\src\stm32f4\ServoTimers.h 1084 | 1085 | 1086 | compile 1087 | 1088 | 1089 | compile 1090 | 1091 | 1092 | compile 1093 | 1094 | 1095 | compile 1096 | 1097 | 1098 | compile 1099 | 1100 | 1101 | compile 1102 | 1103 | 1104 | compile 1105 | 1106 | 1107 | compile 1108 | 1109 | 1110 | 1111 | --------------------------------------------------------------------------------