Exit status 1 'Mix' cannot be used as a function

//#include <SoftwareSerial.h>
//SoftwareSerial EEBlue(0, 1); // RX | TX
//מגדיר את הpins של כל שתייה.
int Vodka = 2;
int CranberryJuice = 3;
int LemonJuice = 4;
int Gin = 5;
int motorPin = 6;
int state = 0;
int Mix;
//כמה זמן יש עד שהוא מחליף לpump הבא.
int TimeBetweenPours = 500;

    void setup()
    {
    Serial.begin (9600);
    Serial.println("The bluetooth gates are open. \n Connect to HC - 05 from any")
    //other bluetooth device with 1234 as pairing key!");

//לעשות את הpins 5-2 לoutput כדי להדליק את הboard relay
; pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
//מוגדר שהrelays יתנו בoutput פחות מתח)מועדף שלא כולם ידלקו באותו הזמן(.
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);

}
//{
//pinMode(motorPin, OUTPUT);
//Serial.begin(9600);
//while (! Serial);
//Serial.println("Speed 0 to 255");
//}
//משתמש כדי לכבות ולהדליק את המנוע, נקרא motorpin .מתי שהקוד נפעל הוא גורם לך
//לתת מספר כדי לשלוט במהירות של המנוע, חייב לתת מספר בין 0 לבין 255.
void loop()
{
if (Serial.available() > 0) {
//בודק האם המידע מגיע מport serial
state = Serial.read();
//קורא את המידע של הport serial
Serial.println(state);
{
//משקאות:
//Cranberry Gin
if (state == 'a') {
Serial.println("Cranberry Gin in the making");
Mix(0, 5000, 2000, 2200); // Vodka, Cranberry juice, Lime juice, Gin
{
//Cape Cod
if (state == 'b') {
Serial.println("Cape Cod in the making");
Mix(1500, 3000, 0, 0); // Vodka, Cranberry juice, Lime juice, Gin
}
//Gimlet
If (state == 'c') {
Serial.printIn("Gimlet in the making");
Mix(0, 0, 800, 3800); // Vodka, Cranberry juice, Lime juice, Gin
}
//בדיקות ותחזוקה
//Set-up Vodka
if (state == 'd')
}
Serial.println("Set-up Vodka");
Mix(1100, 0, 0, 0); // Vodka, Cranberry juice, Lime juice, Gin
{
//Set-up Cranberry juice
if (state == 'e')
}
Serial.println("Set-up Cranberry juice");
Mix(0, 1000, 0, 0); // Vodka, Cranberry juice, Lime juice, Gin
{
//Set-up Lime juice
if (state == 'f') {
Serial.println("Set-up Lime juice");
Mix(0, 0, 1100, 0); // Vodka, Cranberry juice, Lime juice, Gin
}
//Set-up Gin
if (state == 'g') {
Serial.println("Set-up Gin");
Mix(0, 0, 0, 1000); // Vodka, Cranberry juice, Lime juice, Gin
}
//Cleaning
if (state == 'h') {
Serial.println("Set-up Gin");
Mix(4000, 4000, 4000, 4000); // Vodka, Cranberry juice, Lime juice, Gin
}
//Set-up all (intial first time after cleaning)
if (state == 'i')
}
Serial.println("Set-up All");
Mix(800, 800, 800, 1000); // Vodka, Cranberry juice, Lime juice, Gin
{

    }
    void Mix(int DelayTimeVodka, int DelayTimeCranberryJuice, int
             DelayTimeLemonJuice, int DelayTimeGin ) {

      state = 0;
      delay(800);
      digitalWrite(Vodka, LOW) ;
      delay(DelayTimeVodka);
      digitalWrite(Vodka, HIGH) ;
      delay(TimeBetweenPours) ;
      digitalWrite(CranberryJuice, LOW) ;
      delay(DelayTimeCranberryJuice) ;
      digitalWrite(CranberryJuice, HIGH) ;
      delay(TimeBetweenPours);
      digitalWrite(LemonJuice, LOW) ;
      delay(DelayTimeLemonJuice) ;
      digitalWrite(LemonJuice, HIGH) ;
      delay(TimeBetweenPours) ;
      digitalWrite(Gin, LOW) ;
      delay(DelayTimeGin) ;
      digitalWrite(Gin, HIGH) ;
      delay(TimeBetweenPours) ;
      Serial.println("Drink is done!") ;
      state = 0;
    }
    if (Serial.available())
    }
  int speed = Serial.parseInt();
  if (speed >= 0 && speed <= 255)
  }
analogWrite(motorPin, speed);
{
  {
    {

The easier you make it to read and copy your code the more likely it is that you will get help

Please follow the advice given in the link below when posting code , use code tags and post the code here

If you get errors when compiling please copy them from the IDE using the "Copy error messages" button and paste the clipboard here in code tags

You seem to be trying to use Mix both as a variable name and a function name

Change one or both of them to make them different

@fredicha, your topic has been moved to a more suitable location on the forum.

Please use code tags when posting code (see link in post #2).

Your sketch had a bunch of typing errors. Many '{' and '}' were reversed. I have fixed the errors and switched your command parsing from a bunch of 'if' statements to the "switch/case" statement designed to make that easier. It compiles without error or warning for me. Maybe it will do what you want.

//#include <SoftwareSerial.h>
//SoftwareSerial EEBlue(0, 1); // RX | TX
//מגדיר את הpins של כל שתייה.
int Vodka = 2;
int CranberryJuice = 3;
int LemonJuice = 4;
int Gin = 5;
int motorPin = 6;
int state = 0;

//כמה זמן יש עד שהוא מחליף לpump הבא.
int TimeBetweenPours = 500;

void setup()
{
  Serial.begin (9600);
  Serial.println("The bluetooth gates are open. \n Connect to HC - 05 from any");
  //other bluetooth device with 1234 as pairing key!");
  //לעשות את הpins 5-2 לoutput כדי להדליק את הboard relay
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  //מוגדר שהrelays יתנו בoutput פחות מתח)מועדף שלא כולם ידלקו באותו הזמן(.
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
}
//{
//pinMode(motorPin, OUTPUT);
//Serial.begin(9600);
//while (! Serial);
//Serial.println("Speed 0 to 255");
//}
//משתמש כדי לכבות ולהדליק את המנוע, נקרא motorpin .מתי שהקוד נפעל הוא גורם לך
//לתת מספר כדי לשלוט במהירות של המנוע, חייב לתת מספר בין 0 לבין 255.

void loop()
{
  if (Serial.available() > 0)
  {
    //בודק האם המידע מגיע מport serial
    state = Serial.peek(); // Take a peek at the next character
    if (isDigit(state))
    {
      // It's a digit so we read digits for motor speed.
      int speed = Serial.parseInt();
      Serial.println(speed);
      if (speed >= 0 && speed <= 255)
         analogWrite(motorPin, speed);
    }
    else
    {
      // What we peeked was not a digit
      state = Serial.read();
    }

    //קורא את המידע של הport serial
    Serial.println(state);

    switch (state)
    {
      //משקאות:

      case 'a':
        // Cranberry Gin
        Serial.println("Cranberry Gin in the making");
        Mix(0, 5000, 2000, 2200); // Vodka, Cranberry juice, Lime juice, Gin
        break;

      case 'b':
        // Cape Cod
        Serial.println("Cape Cod in the making");
        Mix(1500, 3000, 0, 0); // Vodka, Cranberry juice, Lime juice, Gin
        break;

      case'c':
        //Gimlet
        Serial.println("Gimlet in the making");
        Mix(0, 0, 800, 3800); // Vodka, Cranberry juice, Lime juice, Gin
        break;

      //בדיקות ותחזוקה

      case 'd':
        //Set-up Vodka
        Serial.println("Set-up Vodka");
        Mix(1100, 0, 0, 0); // Vodka, Cranberry juice, Lime juice, Gin
        break;

      case 'e':
        //Set-up Cranberry juice
        Serial.println("Set-up Cranberry juice");
        Mix(0, 1000, 0, 0); // Vodka, Cranberry juice, Lime juice, Gin
        break;

      case 'f':
        //Set-up Lime juice
        Serial.println("Set-up Lime juice");
        Mix(0, 0, 1100, 0); // Vodka, Cranberry juice, Lime juice, Gin
        break;


      case 'g':
        //Set-up Gin
        Serial.println("Set-up Gin");
        Mix(0, 0, 0, 1000); // Vodka, Cranberry juice, Lime juice, Gin
        break;


      case 'h':
        // Cleaning
        Serial.println("Set-up Gin");
        Mix(4000, 4000, 4000, 4000); // Vodka, Cranberry juice, Lime juice, Gin
        break;


      case 'i':
        //Set-up all (intial first time after cleaning)
        Serial.println("Set-up All");
        Mix(800, 800, 800, 1000); // Vodka, Cranberry juice, Lime juice, Gin
        break;
    }
  }
}

void Mix(int DelayTimeVodka, int DelayTimeCranberryJuice, int
         DelayTimeLemonJuice, int DelayTimeGin )
{
  state = 0;
  delay(800);
  digitalWrite(Vodka, LOW) ;
  delay(DelayTimeVodka);
  digitalWrite(Vodka, HIGH) ;
  delay(TimeBetweenPours) ;
  digitalWrite(CranberryJuice, LOW) ;
  delay(DelayTimeCranberryJuice) ;
  digitalWrite(CranberryJuice, HIGH) ;
  delay(TimeBetweenPours);
  digitalWrite(LemonJuice, LOW) ;
  delay(DelayTimeLemonJuice) ;
  digitalWrite(LemonJuice, HIGH) ;
  delay(TimeBetweenPours) ;
  digitalWrite(Gin, LOW) ;
  delay(DelayTimeGin) ;
  digitalWrite(Gin, HIGH) ;
  delay(TimeBetweenPours) ;
  Serial.println("Drink is done!") ;
  state = 0;
}

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.