Robot-Will/Stino

struct "was not declared in this scope"

gianlucaf81 opened this issue · 1 comments

I created a struct and its initialization but SublimeText always returns the error

error: 'recipe' was not declared in this scope

arduino ide compile e run correctly.

any suggestion?

struct recipe {
  String name;
  int temp[5];
  int duration[5];
};

recipe cookbook[] {
  // NOME RICETTA   , TEMPERATURE, TEMPI (minuti)
  {"Pane           ", {220, 180}, {15, 30}},
  {"Brioches       ", {180}, {20}},
  {"Baguettes      ", {240, 180}, {15, 5}},
  {"Rotolo Maiale  ", {240, 160}, {15, 45}},
  {"TEST           ", {39}, {10}},
};

// the setup routine runs once when you press reset:
void setup() {

}

// the loop routine runs over and over again forever:
void loop() {
selectrecipe(cookbook);
}

/* funzione che passato un array di ricette (struct) permette di selezionarle e ritorna il numero progressivo della ricetta*/
int selectrecipe(recipe ric[]) {
  
//do somethings

  
  return (1);              // ritorna il programma selezionato
}

I am having the same difficulty.