This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
bdev:filamentextruder_recyclebot [2022/11/04 22:33] richard |
bdev:filamentextruder_recyclebot [2022/11/05 23:52] (current) richard |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Filament extruder recyclebot ====== | ====== Filament extruder recyclebot ====== | ||
+ | ====== filabotmega.ino ====== | ||
Line 8: | Line 9: | ||
#include < | #include < | ||
#include < | #include < | ||
- | #define dirPin 4 | ||
- | #define stepPin 3 | ||
#define motorInterfaceType 1 | #define motorInterfaceType 1 | ||
#define THERMISTOR_PINA A11 | #define THERMISTOR_PINA A11 | ||
- | #define TEMPCONTROLA | + | #define TEMPCONTROLA |
//Define the aggressive and conservative Tuning Parameters | //Define the aggressive and conservative Tuning Parameters | ||
Line 29: | Line 28: | ||
- | const int stepsPinA = 0; | + | const int stepsPinA = 11; |
- | const int directionPinA = 1; | + | const int directionPinA = 12; |
const int enablePinA = 2; | const int enablePinA = 2; | ||
+ | |||
+ | |||
const int stepsPinB = 3; | const int stepsPinB = 3; | ||
const int directionPinB = 4; | const int directionPinB = 4; | ||
const int enablePinB = 5; | const int enablePinB = 5; | ||
- | const int stepsPinC = 6; | + | |
- | const int directionPinC = 7; | + | const int stepsPinC = 7; |
- | const int enablePinC = 8; | + | const int directionPinC = 8; |
+ | const int enablePinC = 9; | ||
const int gobuttonA = A0; | const int gobuttonA = A0; | ||
const int stopbuttonA = A1; | const int stopbuttonA = A1; | ||
const int speedpotA = A2; | const int speedpotA = A2; | ||
- | const int gobuttonB = A3; | + | |
- | const int stopbuttonB = A4; | + | const int gobuttonB = A5; |
- | const int speedpotB = A5; | + | const int stopbuttonB = A6; |
- | const int gobuttonC = A6; | + | const int speedpotB = A3; |
- | const int stopbuttonC = A7; | + | |
- | const int speedpotC = A8; | + | const int gobuttonC = A7; |
+ | const int stopbuttonC = A10; | ||
+ | const int speedpotC = A4; | ||
int directionA = 0; | int directionA = 0; | ||
Line 105: | Line 109: | ||
+ | |||
+ | Serial.print("" | ||
+ | | ||
+ | digitalWrite(stepsPinA, | ||
+ | digitalWrite(directionPinA, | ||
+ | digitalWrite(enablePinA, | ||
+ | |||
+ | |||
+ | digitalWrite(stepsPinB, | ||
+ | digitalWrite(directionPinB, | ||
+ | digitalWrite(enablePinB, | ||
+ | |||
+ | digitalWrite(stepsPinC, | ||
+ | digitalWrite(directionPinC, | ||
+ | digitalWrite(enablePinC, | ||
+ | |||
+ | |||
+ | /* | ||
if (levelstreamon == 1) { | if (levelstreamon == 1) { | ||
| | ||
Line 126: | Line 148: | ||
} else { bfl = 0; } | } else { bfl = 0; } | ||
- | if (digitalRead(gobuttonA) == HIGH){ | + | if (digitalRead(gobuttonA) == 1){ |
+ | | ||
| | ||
} | } | ||
Line 139: | Line 162: | ||
} else { bfl = 0; } | } else { bfl = 0; } | ||
- | if (digitalRead(gobuttonB) == HIGH){ | + | if (digitalRead(gobuttonB) == 1){ |
+ | Serial.println(" | ||
| | ||
} | } | ||
+ | if (digitalRead(stopbuttonC) ==HIGH){ | ||
+ | if (bfl == 0){ | ||
+ | if (directionC==0){directionC = 1; digitalWrite(directionPinC, | ||
+ | Serial.print(directionC); | ||
+ | Serial.println(" | ||
+ | bfl = 1; | ||
+ | } | ||
+ | } else { bfl = 0; } | ||
+ | |||
+ | if (digitalRead(gobuttonC) == 1){ | ||
+ | Serial.println(" | ||
+ | | ||
+ | } | ||
+ | */ | ||
+ | |||
+ | |||
+ | | ||
| | ||
{ | { |