Dukweeno / Duckuino

Simple DuckyScript to Arduino C converter.
https://dukweeno.github.io/Duckuino/
MIT License
353 stars 117 forks source link

Issue when compiling the sketch : "OSX Wallpaper Changer" #17

Closed JonasZaverka closed 7 years ago

JonasZaverka commented 7 years ago

Hi I'm trying to translate basic OSX Wallpaper Changer and this error comes up in my compiler:

osxwall3:1: error: expected constructor, destructor, or type conversion before '(' token

 typeKey(KEY_RETURN);

        ^

osxwall3:3: error: 'Keyboard' does not name a type

   Keyboard.print("cd Desktop/");

   ^

osxwall3:5: error: expected constructor, destructor, or type conversion before '(' token

   typeKey(KEY_RETURN);

          ^

osxwall3:7: error: 'Keyboard' does not name a type

   Keyboard.print("rm 1283877178.or.61533.jpg");

   ^

osxwall3:9: error: expected constructor, destructor, or type conversion before '(' token

   typeKey(KEY_RETURN);

          ^

osxwall3:11: error: expected constructor, destructor, or type conversion before '(' token

   delay(100);

        ^

osxwall3:13: error: 'Keyboard' does not name a type

   Keyboard.print("cd");

   ^

osxwall3:15: error: expected constructor, destructor, or type conversion before '(' token

   typeKey(KEY_RETURN);

          ^

osxwall3:17: error: expected constructor, destructor, or type conversion before '(' token

   delay(50);

        ^

osxwall3:19: error: 'Keyboard' does not name a type

   Keyboard.print("history -c");

   ^

osxwall3:21: error: expected constructor, destructor, or type conversion before '(' token

   typeKey(KEY_RETURN);

          ^

osxwall3:23: error: 'Keyboard' does not name a type

   Keyboard.press(KEY_LEFT_GUI);

   ^

osxwall3:24: error: 'Keyboard' does not name a type

   Keyboard.press('w');

   ^

osxwall3:25: error: 'Keyboard' does not name a type

   Keyboard.releaseAll();

   ^

osxwall3:26: error: expected constructor, destructor, or type conversion before '(' token

   delay(100);

        ^

osxwall3:28: error: 'Keyboard' does not name a type

   Keyboard.press(KEY_LEFT_GUI);

   ^

osxwall3:29: error: 'Keyboard' does not name a type

   Keyboard.press('q');

   ^

osxwall3:30: error: 'Keyboard' does not name a type

   Keyboard.releaseAll();

   ^

osxwall3:33: error: 'Keyboard' does not name a type

   Keyboard.end();

   ^

osxwall3:34: error: expected declaration before '}' token

 }

 ^

exit status 1
expected constructor, destructor, or type conversion before '(' token
Plazmaz commented 7 years ago

You should post the generated sketch file. Looks like you're missing the keyboard library.

lowlevl commented 7 years ago

Sounds like a syntax error, did you downloaded or copied the script ? (Are you on Linux ? And if yes did you installed Arduino IDE with apt-get ?)

Plazmaz commented 7 years ago

Will close this issue in a bit if we don't get a response from @JonasZaverka

Plazmaz commented 7 years ago

Closing the issue due to inactivity