From c56c0978e62314fd65701deb7d39ad3db57efa8a Mon Sep 17 00:00:00 2001 From: ReiMerc Date: Wed, 29 Nov 2023 16:25:57 +0100 Subject: [PATCH] Fix indentation --- arduino/arduino.ino | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/arduino/arduino.ino b/arduino/arduino.ino index dece6d2..defc9fc 100644 --- a/arduino/arduino.ino +++ b/arduino/arduino.ino @@ -58,22 +58,22 @@ void setup(void) carrier.display.fillScreen(0x000); - //pinouts til motor - pinMode(motor_pin1, OUTPUT); - pinMode(motor_pin2, OUTPUT); - pinMode(motor_pin3, OUTPUT); - pinMode(motor_pin4, OUTPUT); + // Pinouts for motor + pinMode(motor_pin1, OUTPUT); + pinMode(motor_pin2, OUTPUT); + pinMode(motor_pin3, OUTPUT); + pinMode(motor_pin4, OUTPUT); } void loop(void) { - // Rotate motor if needed - if (motor_count) { - motor_clockwise(); - motor_count--; - } + // Rotate motor if needed + if (motor_count) { + motor_clockwise(); + motor_count--; + } - // Receive MQTT messages + // Receive MQTT messages int message_size = mqtt_client.parseMessage(); if (message_size) { Serial.print("Got message with topic: "); @@ -83,30 +83,30 @@ void loop(void) Serial.println("Dispensing..."); // Start rotating motor - motor_count = motor_count_max; + motor_count = motor_count_max; } } } void motor_clockwise() { - for (int i = 7; i >= 0; i--) { - motor_set_output(i); - delayMicroseconds(motor_speed); - } + for (int i = 7; i >= 0; i--) { + motor_set_output(i); + delayMicroseconds(motor_speed); + } } void motor_anticlockwise() { - for (int i = 0; i < 8; i++) { - motor_set_output(i); - delayMicroseconds(motor_speed); - } + for (int i = 0; i < 8; i++) { + motor_set_output(i); + delayMicroseconds(motor_speed); + } } void motor_set_output(int out) { - digitalWrite(motor_pin1, bitRead(motor_lookup[out], 0)); - digitalWrite(motor_pin2, bitRead(motor_lookup[out], 1)); - digitalWrite(motor_pin3, bitRead(motor_lookup[out], 2)); - digitalWrite(motor_pin4, bitRead(motor_lookup[out], 3)); + digitalWrite(motor_pin1, bitRead(motor_lookup[out], 0)); + digitalWrite(motor_pin2, bitRead(motor_lookup[out], 1)); + digitalWrite(motor_pin3, bitRead(motor_lookup[out], 2)); + digitalWrite(motor_pin4, bitRead(motor_lookup[out], 3)); }