Having problems in Combining multiple codeblocks to a Single Arduino code for a System having multiple section of works

We are finalizing the total source code of our "Smart pet care system", there are 2 servo motors, 1 Ultrasonic sensor, 1 water level sensor, 1 water pump, and 1 LED...
following is the connection pins on the Arduino Uno,


"0-
1-
2- trigger
3- echo
4- Servo2
5- LED1
6-
7- Water Pump
8- Servo1

9- RST
10- SDA
11- MOSI
12- MISO
13- SCK"

we have did our code by 4 parts which are working fine individually, following will explain those 4 types of codes,


Code 1: This code is to control the maingate of our system, it uses Servo1 to control the system according to the following code,

"

#include <Servo.h>
#include <MFRC522.h>
#include <SPI.h>

// Pin definitions
#define SS_PIN 10
#define RST_PIN 9

// Create instances for Servo and RFID reader
Servo myServo1;
MFRC522 mfrc522(SS_PIN, RST_PIN);

// RFID UID
byte targetUID[] = {0xA0, 0x84, 0x2C, 0x0E};

void setup() {
  // Attach the servo to pin 8
  myServo1.attach(8);
  
  // Initialize SPI bus and MFRC522 RFID reader
  SPI.begin();
  mfrc522.PCD_Init();
  
  // Start with the gate closed
  myServo1.write(90);  // 90 degrees = closed position
}

void loop() {
  // Look for new RFID cards
  if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) {
    // Check if the detected UID matches the target UID
    if (checkUID(mfrc522.uid.uidByte)) {
      // Open the gate (move servo to 0 degrees)
      for (int angle = 90; angle >= 0; angle--) {
        myServo1.write(angle);
        delay(15);  // Adjust delay for smooth movement
      }

      delay(5000);  // Keep the gate open for 5 seconds

      // Close the gate (move servo back to 90 degrees)
      for (int angle = 0; angle <= 90; angle++) {
        myServo1.write(angle);
        delay(15);  // Adjust delay for smooth movement
      }
    }

    // Halt PICC so it stops reading
    mfrc522.PICC_HaltA();
  }
}

// Function to check if the UID matches the target UID
bool checkUID(byte *uid) {
  for (byte i = 0; i < 4; i++) {
    if (uid[i] != targetUID[i]) {
      return false;
    }
  }
  return true;
}

"

Code2: this code is for controlling the food dispenser, which will open the door of the hole of the food chamber for 2 seconds for every 1 min by using Servo2. which shows the following code,

"

#include <Servo.h>

// Create servo objects
Servo myServo2; // Servo2 for food dispensing

void setup() {
  // Attach the servos to their respective pins
  myServo2.attach(4);  // Servo2 on pin 4
}

void loop() {
// Control Servo2 (food dispensing)
  myServo2.write(0);  // Move servo2 to 0 degrees (initial position)
  delay(60000);        // Wait for 2 seconds
  myServo2.write(45); // Move servo2 to 45 degrees
  delay(2000);        // Wait for 2 seconds
}

"

Code 3: this code is to check the level of the food, my container's length is 27cm(Vertically). if the empty space exceeds 20cms the LED will blink, which shows the following code,

"

const int trigPin = 2;  // Trig pin connected to pin 2
const int echoPin = 3;  // Echo pin connected to pin 3
const int ledPin = 5;   // LED connected to pin 5

long duration;
int distance;

void setup() {
  // Initialize the serial communication
  Serial.begin(9600);
  
  // Set the trigPin as an output and the echoPin as an input
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  
  // Set the ledPin as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Clear the trigPin by setting it LOW
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  
  // Trigger the sensor by setting the trigPin HIGH for 10 microseconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  
  // Read the echoPin, which returns the duration of the pulse in microseconds
  duration = pulseIn(echoPin, HIGH);
  
  // Calculate the distance in centimeters
  distance = duration * 0.034 / 2; // Speed of sound is 343 m/s or 0.034 cm/µs
  
  // Print the distance to the Serial Monitor
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  
  // Check if the distance is 20 cm or less
  if (distance >= 20) {
    // Blink the LED
    digitalWrite(ledPin, HIGH);  // Turn on the LED
    delay(250);                  // Wait for 250 milliseconds
    digitalWrite(ledPin, LOW);   // Turn off the LED
    delay(250);                  // Wait for 250 milliseconds
  } else {
    // Ensure the LED is off when the distance is greater than 20 cm
    digitalWrite(ledPin, LOW);
  }
  
  // Wait before the next measurement
  delay(500);
}

"

Code 4: This is for managing the water level using the water level sensor. the following code shows that,

"

// Constants for the pins used
const int analogInPin = A0;  // Analog input pin for the water level sensor
const int pumpPin = 7;       // Digital output pin for the water pump

int sensorValue = 0;  // Value read from the water level sensor

void setup() {
  // Initialize serial communication at 9600 bps
  Serial.begin(9600);
  
  // Set the pumpPin as an output
  pinMode(pumpPin, OUTPUT);
}

void loop() {
  // Read the analog value from the water level sensor
  sensorValue = analogRead(analogInPin);

  // Print the sensor value to the Serial Monitor
  Serial.print("Water level sensor value = ");
  Serial.println(sensorValue);

  // Check if the sensor value is less than 280
  if (sensorValue < 280) {
    // Turn on the water pump
    digitalWrite(pumpPin, HIGH);
    
    // Keep the pump on for 5 seconds
    delay(5000);
    
    // Turn off the water pump
    digitalWrite(pumpPin, LOW);
  }

  // Wait 2 milliseconds before the next loop for the analog-to-digital
  // converter to settle after the last reading
  delay(2);
}

"

Finally, I want to combine the whole code into one Arduino code for to work the whole system. without changing any meaning of the codes... I have tried some ways, but they didn't resolve my problem.. please help me to find the solution

Show what you've tried and someone can help you figure out what went wrong. Since each of these codes relies on delay for timing, it will be nearly impossible to simply combine them. You will need to allow the program to keep running and not trap it on a single line that takes hours to finish.

2 Likes

in general, you could just rename our 4 setup() and loop() as setup1(), setup2(), ... and call each in a new setup() and loop() such as

void setup ()
{
    setup1 ();
    setup2 ();
    setup3 ();
    setup4 ();
}

of course they don't need to be in separate functions, just the code in each needs to be in setup(), less any redundant code. and similarly for the loop() functions.

give it a try

2 Likes

Well, the first thing I would do is get rid of all those delays and use millis() instead. You have a lot of blocking code.

2 Likes

as already mentioned:
First step is to write 4 "non blocking" codes.
Without any delays or blocking while loops waiting for an event.

As I just spotted a delay to slow down servo movement, ... here I have an short example of a smooth servo:

just in case you were would copy paste any code - please credit the author.

2 Likes

This short hint has a high danger of making it extra hard to understand how non-blocking timing works.

Such a short sentence can create the totally wrong picture of
replace delay() with millis() and you are done.

If this totally wrong picture is created in the head of a newcomer this newcomer will have extra confusion caused by this wrong picture if she/he starts to read this classical blink without delay-example-code from the IDE

This classical blink without delay-example does not:

  • explain the fundamental difference between delay() and non-blocking timing
  • has non-intuitive variable-names
  • where a part of these variables are distributed over multiple lines of code

Trying to understand this bwd-code with a picture in mind "just replace delay() with millis() causes extra-confusion because the code is totally different from "just replace delay() with millis()

In my opinion this BWD-example must be heavily revised or at least no longer recommended to understand how non-blocking timing works.

A much better explanation is this video

1 Like

Right!

For that step I'd suggest the use of TaskMacros which allow to simply replace blocking delay() by the non-blocking taskDelay(). Make each loop() a distinct task and you're almost done.

1 Like

I would not attempt to merge the individual files into a single .ino file
have separate .cpp files with associated .h header files containing extern declarations and function prototypes

1 Like

Hi @foreverknight0416,

your separate sketches do the following (simplified):

Code 1: Gate Control

  • Set the gate to closed (90 degrees)
  • LOOP
    • Checks for a RFID tags
    • In case a new tag was found and it has the targetUID:
      • The gate opens (moves from 90 degrees to 0)
      • The sketch waits for 5 sec
      • The gate closes again
    • goto LOOP

Code 2: Food Dispenser

  • LOOP
    • Move servo to 0 degrees
    • Wait for 60 sec
    • Move servo to 45 degrees
    • Wait for 2 sec
    • goto LOOP

Code 3: Distance Measurement with LED signal

  • LOOP
    • Measure and print distance
    • If distance >= 20 cm switch LED on for 250 ms
    • Else switch LED off
    • Wait for 500 ms
    • goto LOOP

Code 4: Pump Controlled by Water Level

  • LOOP
    • Read and print an anlog value that represents the water level
    • If the sensor value < 280 then switch the pump on for 5 sec
    • goto LOOP

To my understanding:

  • Codes 1 and 4 may generally work as intended.
  • Code 2 does not seem to work properly unless "Food dispensing" is only time controlled.
  • Code 3 does not match its comments.

I might be wrong ...

2 Likes

Can you provide a link to a tutorial that explains that?

I have analysed the traffic-light demo-code. (multiple tasks ehm sorry two tasks).

I have read the macros.

Well I highly doubt that a real beginner will be able to apply the taskmacros for his own code.

You would have to explain the pattern in much more detail than just presenting code.
There are some things you must pay attention to which should be explicitly explained to beginners. Otherwise beginners are in danger to not understand these limiting conditions.

Most important you have to divide your code into multiple sequences
each of these sequences must be in their own function.

For each sequence executing code further down the function is only executed if all more upper taskDelay()'s are over.

Which means if something shall be done non-blocking it must be placed inside its own function because your first function does not execute further down writte code before all upper taskDelay() have their waiting time passed by.

If my explanation is wrong this witnesses that everything is really tricky and needs even more explanation to get it working.

1 Like

Isn't that just the starting point with the 4 distinct loop()s of the TO? So far it's clear which are the task functions which have to be made non-blocking by using taskDelay() instead of delay().

1 Like

Are you sure that you want the food dispenser beeing active
24 hours each day 7 days a week?

Which means once every 62 seconds of each day which is 1393 times each day
food will be dispensed.

1 Like

Here is the code

#include <ALib0.h>

#include <Servo.h>
#include <MFRC522.h>
#include <SPI.h>

// Pin definitions
#define SS_PIN 10
#define RST_PIN 9

// Create instances for Servo and RFID reader
Servo myServo1;
// Create servo objects
Servo myServo2; // Servo2 for food dispensing

MFRC522 mfrc522(SS_PIN, RST_PIN);

// RFID UID
byte targetUID[] = {0xA0, 0x84, 0x2C, 0x0E};

const int trigPin = 2;  // Trig pin connected to pin 2
const int echoPin = 3;  // Echo pin connected to pin 3
const int ledPin  = 5;   // LED connected to pin 5

long duration;
int distance;

// Constants for the pins used
const int analogInPin = A0;  // Analog input pin for the water level sensor
const int pumpPin = 7;       // Digital output pin for the water pump

int sensorValue = 0;  // Value read from the water level sensor


void setup() {
  setup1();
  setup2();
  setup3();
  setup4();
}


void loop() {
  loop1();
  loop2();
  loop3();
  loop4();
}


void setup1() {
  // Attach the servo to pin 8
  myServo1.attach(8);
  
  // Initialize SPI bus and MFRC522 RFID reader
  SPI.begin();
  mfrc522.PCD_Init();
  
  // Start with the gate closed
  myServo1.write(90);  // 90 degrees = closed position
}

void loop1() {
  // Look for new RFID cards
  if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) {
    // Check if the detected UID matches the target UID
    if (checkUID(mfrc522.uid.uidByte)) {
      // Open the gate (move servo to 0 degrees)
      for (int angle = 90; angle >= 0; angle--) {
        myServo1.write(angle);
        taskDelay(15);  // Adjust delay for smooth movement
      }

      taskDelay(5000);  // Keep the gate open for 5 seconds

      // Close the gate (move servo back to 90 degrees)
      for (int angle = 0; angle <= 90; angle++) {
        myServo1.write(angle);
        taskDelay(15);  // Adjust delay for smooth movement
      }
    }

    // Halt PICC so it stops reading
    mfrc522.PICC_HaltA();
  }
}

// Function to check if the UID matches the target UID
bool checkUID(byte *uid) {
  for (byte i = 0; i < 4; i++) {
    if (uid[i] != targetUID[i]) {
      return false;
    }
  }
  return true;
}


void setup2() {
  // Attach the servos to their respective pins
  myServo2.attach(4);  // Servo2 on pin 4
}

void loop2() {
// Control Servo2 (food dispensing)
  myServo2.write(0);  // Move servo2 to 0 degrees (initial position)
  taskDelay(60000);        // Wait for 2 seconds
  myServo2.write(45); // Move servo2 to 45 degrees
  taskDelay(2000);        // Wait for 2 seconds
}


void setup3() {
  // Initialize the serial communication
  Serial.begin(9600);
  
  // Set the trigPin as an output and the echoPin as an input
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  
  // Set the ledPin as an output
  pinMode(ledPin, OUTPUT);
}

void loop3() {
  // Clear the trigPin by setting it LOW
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  
  // Trigger the sensor by setting the trigPin HIGH for 10 microseconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  
  // Read the echoPin, which returns the duration of the pulse in microseconds
  duration = pulseIn(echoPin, HIGH);
  
  // Calculate the distance in centimeters
  distance = duration * 0.034 / 2; // Speed of sound is 343 m/s or 0.034 cm/µs
  
  // Print the distance to the Serial Monitor
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
  
  // Check if the distance is 20 cm or less
  if (distance >= 20) {
    // Blink the LED
    digitalWrite(ledPin, HIGH);  // Turn on the LED
    taskDelay(250);                  // Wait for 250 milliseconds
    digitalWrite(ledPin, LOW);   // Turn off the LED
    taskDelay(250);                  // Wait for 250 milliseconds
  } else {
    // Ensure the LED is off when the distance is greater than 20 cm
    digitalWrite(ledPin, LOW);
  }
  
  // Wait before the next measurement
  taskDelay(500);
}


void setup4() {
  // Initialize serial communication at 9600 bps
  //Serial.begin(9600);
  
  // Set the pumpPin as an output
  pinMode(pumpPin, OUTPUT);
}

void loop4() {
  // Read the analog value from the water level sensor
  sensorValue = analogRead(analogInPin);

  // Print the sensor value to the Serial Monitor
  Serial.print("Water level sensor value = ");
  Serial.println(sensorValue);

  // Check if the sensor value is less than 280
  if (sensorValue < 280) {
    // Turn on the water pump
    digitalWrite(pumpPin, HIGH);
    
    // Keep the pump on for 5 seconds
    taskDelay(5000);
    
    // Turn off the water pump
    digitalWrite(pumpPin, LOW);
  }

  // Wait 2 milliseconds before the next loop for the analog-to-digital
  // converter to settle after the last reading
  taskDelay(2);
}

and here is the compiler-error-message:

Arduino: 1.8.19 (Windows 10), TD: 1.58, Board: "Arduino Uno"





















C:\Arduino-Pure-Portable\arduino-1.8.19\arduino-builder -dump-prefs -logger=machine -hardware C:\Arduino-Pure-Portable\arduino-1.8.19\hardware -hardware C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages -tools C:\Arduino-Pure-Portable\arduino-1.8.19\tools-builder -tools C:\Arduino-Pure-Portable\arduino-1.8.19\hardware\tools\avr -tools C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages -libraries C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10819 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_211490 -warnings=all -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_750915 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino

C:\Arduino-Pure-Portable\arduino-1.8.19\arduino-builder -compile -logger=machine -hardware C:\Arduino-Pure-Portable\arduino-1.8.19\hardware -hardware C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages -tools C:\Arduino-Pure-Portable\arduino-1.8.19\tools-builder -tools C:\Arduino-Pure-Portable\arduino-1.8.19\hardware\tools\avr -tools C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages -libraries C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries -fqbn=arduino:avr:uno -vid-pid=1A86_7523 -ide-version=10819 -build-path C:\Users\dipl-\AppData\Local\Temp\arduino_build_211490 -warnings=all -build-cache C:\Users\dipl-\AppData\Local\Temp\arduino_cache_750915 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avrdude.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.arduinoOTA.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino

Using board 'uno' from platform in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\hardware\avr\1.8.6

Using core 'arduino' from platform in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o nul

Alternatives for ALib0.h: [ALib0@1.0]

ResolveLibrary(ALib0.h)

  -> candidates: [ALib0@1.0]

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o nul

Alternatives for Servo.h: [Servo@1.2.0]

ResolveLibrary(Servo.h)

  -> candidates: [Servo@1.2.0]

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o nul

Alternatives for MFRC522.h: [MFRC522@1.4.10]

ResolveLibrary(MFRC522.h)

  -> candidates: [MFRC522@1.4.10]

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o nul

Alternatives for SPI.h: [SPI@1.0]

ResolveLibrary(SPI.h)

  -> candidates: [SPI@1.0]

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src\\AButton.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\avr\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\mbed\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\megaavr\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\nrf52\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\renesas\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\sam\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\samd\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src\\stm32f4\\Servo.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src\\MFRC522.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src\\MFRC522Extended.cpp" -o nul

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src\\SPI.cpp" -o nul

Generating function prototypes...

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\preproc\\ctags_target_for_gcc_minus_e.cpp"

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\ALib0\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\Servo\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\sketchbook\\libraries\\MFRC522\\src" "-IC:\\Arduino-Pure-Portable\\arduino-1.8.19\\portable\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp" -o "C:\\Users\\dipl-\\AppData\\Local\\Temp\\arduino_build_211490\\sketch\\taskMacros-loop1-4-001.ino.cpp.o"

In file included from C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:1:0:

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino: In function 'void loop1()':

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:71:9: note: in expansion of macro 'taskDelay'

         taskDelay(15);  // Adjust delay for smooth movement

         ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:71:9: note: in expansion of macro 'taskDelay'

         taskDelay(15);  // Adjust delay for smooth movement

         ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '71' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:71:9: note: in expansion of macro 'taskDelay'

         taskDelay(15);  // Adjust delay for smooth movement

         ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:74:7: note: in expansion of macro 'taskDelay'

       taskDelay(5000);  // Keep the gate open for 5 seconds

       ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:74:7: note: in expansion of macro 'taskDelay'

       taskDelay(5000);  // Keep the gate open for 5 seconds

       ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '74' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:74:7: note: in expansion of macro 'taskDelay'

       taskDelay(5000);  // Keep the gate open for 5 seconds

       ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:79:9: note: in expansion of macro 'taskDelay'

         taskDelay(15);  // Adjust delay for smooth movement

         ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '79' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:79:9: note: in expansion of macro 'taskDelay'

         taskDelay(15);  // Adjust delay for smooth movement

         ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino: In function 'void loop2()':

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:107:3: note: in expansion of macro 'taskDelay'

   taskDelay(60000);        // Wait for 2 seconds

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:107:3: note: in expansion of macro 'taskDelay'

   taskDelay(60000);        // Wait for 2 seconds

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '107' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:107:3: note: in expansion of macro 'taskDelay'

   taskDelay(60000);        // Wait for 2 seconds

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:109:3: note: in expansion of macro 'taskDelay'

   taskDelay(2000);        // Wait for 2 seconds

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '109' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:109:3: note: in expansion of macro 'taskDelay'

   taskDelay(2000);        // Wait for 2 seconds

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino: In function 'void loop3()':

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:150:5: note: in expansion of macro 'taskDelay'

     taskDelay(250);                  // Wait for 250 milliseconds

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:150:5: note: in expansion of macro 'taskDelay'

     taskDelay(250);                  // Wait for 250 milliseconds

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '150' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:150:5: note: in expansion of macro 'taskDelay'

     taskDelay(250);                  // Wait for 250 milliseconds

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:152:5: note: in expansion of macro 'taskDelay'

     taskDelay(250);                  // Wait for 250 milliseconds

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '152' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:152:5: note: in expansion of macro 'taskDelay'

     taskDelay(250);                  // Wait for 250 milliseconds

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:159:3: note: in expansion of macro 'taskDelay'

   taskDelay(500);

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:159:3: note: in expansion of macro 'taskDelay'

   taskDelay(500);

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '159' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:159:3: note: in expansion of macro 'taskDelay'

   taskDelay(500);

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino: In function 'void loop4()':

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:185:5: note: in expansion of macro 'taskDelay'

     taskDelay(5000);

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:185:5: note: in expansion of macro 'taskDelay'

     taskDelay(5000);

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '185' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:185:5: note: in expansion of macro 'taskDelay'

     taskDelay(5000);

     ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:30: error: 'time_Stamp' was not declared in this scope

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                              ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:193:3: note: in expansion of macro 'taskDelay'

   taskDelay(2);

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:25: error: '_mark' was not declared in this scope

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                         ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:193:3: note: in expansion of macro 'taskDelay'

   taskDelay(2);

   ^~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:13:51: error: case label '193' not within a switch statement

  #define taskSwitch() { _mark = __LINE__; return; case __LINE__: ; }

                                                   ^

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0\src/ALib0.h:14:53: note: in expansion of macro 'taskSwitch'

  #define taskDelay(interval) time_Stamp = millis(); taskSwitch(); if ((millis() - time_Stamp) < (interval)) return;

                                                     ^~~~~~~~~~

C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\taskMacros-loop1-4-001\taskMacros-loop1-4-001.ino:193:3: note: in expansion of macro 'taskDelay'

   taskDelay(2);

   ^~~~~~~~~

Using library ALib0 at version 1.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\ALib0 

Using library Servo at version 1.2.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\Servo 

Using library MFRC522 at version 1.4.10 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\sketchbook\libraries\MFRC522 

Using library SPI at version 1.0 in folder: C:\Arduino-Pure-Portable\arduino-1.8.19\portable\packages\arduino\hardware\avr\1.8.6\libraries\SPI 

exit status 1

Error compiling for board Arduino Uno.
1 Like

And I guess
not really waiting here

 // Wait before the next measurement
  taskDelay(500);
  taskEnd();   
}

before triggering the ultra-sonic sensor might cause trouble

void loop3() {
  taskBegin();

  // Clear the trigPin by setting it LOW
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);

  // Trigger the sensor by setting the trigPin HIGH for 10 microseconds
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Read the echoPin, which returns the duration of the pulse in microseconds
  duration = pulseIn(echoPin, HIGH);

  // Calculate the distance in centimeters
  distance = duration * 0.034 / 2; // Speed of sound is 343 m/s or 0.034 cm/µs

  // Print the distance to the Serial Monitor
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  // Check if the distance is 20 cm or less
  if (distance >= 20) {
    // Blink the LED
    digitalWrite(ledPin, HIGH);  // Turn on the LED
    taskDelay(250);                  // Wait for 250 milliseconds
    digitalWrite(ledPin, LOW);   // Turn off the LED
    taskDelay(250);                  // Wait for 250 milliseconds
  } else {
    // Ensure the LED is off when the distance is greater than 20 cm
    digitalWrite(ledPin, LOW);
  }

  // Wait before the next measurement
  taskDelay(500);
  taskEnd();   
}
1 Like

Of course taskDelay() can not be used outside of a task function.

1 Like

What makes a function a task-function?
So what has to be changed to make it work?

1 Like

You have seen the example?

Yes. And this means your description

could be more detailed by writing:

At the begin of each task-function which in case of user @foreverknight0416 is the renamed functions loop() to
loop1()
loop2()
loop3()
loop4()

Need a function-call taskBegin(); as the first line
and
a function-call taskEnd(); as the very last line

basic structure:

void loop1() {
  taskBegin();
  // all code that shall be delayed by using taskDelay()

  taskEnd();   
} // closing curly brace of void loop1() 

So this means beside replacing delay() with taskDelay() the function-calls
taskBegin(); and taskEnd();

must be added to make a function a task-function.
IMHO it would be very good if you add this information in each example-code

But I am pretty sure adding this information is seen as "newcomers won't learn and do just copy & paste if this information is added".

Or maybe "if this information is added it will be too easy for newcomers to climb up the learning curve"

IMHO this forum is for sharing information.

1 Like

hello Sir, this is a project that we need to demonstrate. Actually, we need to distribute the food once every 6 hours. But for the sake of demonstration, I have made it once in every minute