fit code to the new board

This commit is contained in:
2019-07-10 14:02:49 +03:00
parent d6e881bb39
commit 46bd7c4b29
5 changed files with 14 additions and 14 deletions

View File

@@ -15,11 +15,11 @@
#define STEPS_PER_REVOLUTION (360/1.8) * 32
#define DEF_RPM 2
Stepper eggStepper(24, 25, STEPS_PER_REVOLUTION, 0, Y_DEGREES_PER_MM);
Stepper servoStepper(28, 29, -STEPS_PER_REVOLUTION, X_LIMIT,
Stepper eggStepper(6, 5, STEPS_PER_REVOLUTION, 0, Y_DEGREES_PER_MM);
Stepper servoStepper(4, 3, -STEPS_PER_REVOLUTION, X_LIMIT,
X_DEGREES_PER_MM);
Pen pen(23, 120, 180);
Pen pen(7, 120, 180);
unsigned int eggStepperDelay;
unsigned int servoStepperDelay;

View File

@@ -10,17 +10,14 @@
[env:motorcontrol]
platform = atmelavr
board = uno
framework = arduino
board = mightycore32
board_build.mcu = atmega32
board_build.f_cpu = 16000000L
build_flags =
board_upload.speed = 115200
monitor_speed = 9600
monitor_speed = 115200
upload_protocol = stk500
upload_flags =

View File

@@ -112,24 +112,24 @@ void execCommand() {
}
void setup() {
cli();
Serial.begin(115200);
Wire.begin(8);
Wire.onReceive(receiveEvent);
Wire.onRequest(requestEvent);
Serial.println("Hello!");
eggStepperRPM = servoStepperRPM = curRPM;
OCR2 = 250;
TCCR2 |= (1 << WGM20) | (1 << CS22);
TIMSK |= (1 << OCIE2);
sei();
pinMode(A0, OUTPUT);
digitalWrite(A0, true);
OCR0A = 250;
TCCR0A |= (1 << WGM20) | (1 << CS22);
TIMSK0 |= (1 << OCIE0A);
servoStepper.setPos(X_LIMIT);
pen.init();
}
unsigned int ms = 0;
ISR(TIMER2_COMP_vect) {
ISR(TIMER0_COMPA_vect) {
ms++;
if (ms % adjustDelay == 0) {
adjustRPM();