Robot-Will / Stino

A Sublime Text Plugin for Arduino
Other
1.58k stars 250 forks source link

struct "was not declared in this scope" #507

Open gianlucaf81 opened 5 years ago

gianlucaf81 commented 5 years ago

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
}
obromios commented 3 years ago

I am having the same difficulty.