LuiCat / ArduinoTaikoController

Sketch for Arduino based taiko game controller circuit for PC and Nintendo Switch
MIT License
130 stars 39 forks source link

ct not declared error. #5

Closed Gauntmon closed 3 years ago

Gauntmon commented 4 years ago

I keep getting this error code:

Arduino: 1.8.13 (Windows 10), Board: "Nintendo Switch Controller (Micro/Leo)"

In file included from sketch\Joystick.cpp:2:0:

sketch\HIDReportData.h:49:3: warning: #warning Modified LUFA header file. Remove the file if problematic. [-Wcpp]

  #warning Modified LUFA header file. Remove the file if problematic.

   ^~~~~~~

C:\Users\dalla\Documents\Arduino\ArduinoTaikoController-master\taiko_controller\taiko_controller.ino: In function 'void loop()':

taiko_controller:302:7: error: 'ct' was not declared in this scope

   if (ct > 32000 || (ct > 8000 && (down_count[0] || down_count[1] || down_count[2] || down_count[3]))) {

       ^~

C:\Users\dalla\Documents\Arduino\ArduinoTaikoController-master\taiko_controller\taiko_controller.ino:302:7: note: suggested alternative: 'dt'

   if (ct > 32000 || (ct > 8000 && (down_count[0] || down_count[1] || down_count[2] || down_count[3]))) {

       ^~

       dt

taiko_controller:309:5: error: 'state' was not declared in this scope

     state = 0;

     ^~~~~

C:\Users\dalla\Documents\Arduino\ArduinoTaikoController-master\taiko_controller\taiko_controller.ino:309:5: note: suggested alternative: 'static'

     state = 0;

     ^~~~~

     static

taiko_controller:311:17: error: 'button_state' was not declared in this scope

       state |= (button_state[i] ? 1 << i : 0);

                 ^~~~~~~~~~~~

taiko_controller:313:20: error: 'hat_mapping' was not declared in this scope

     Joystick.HAT = hat_mapping[state];

                    ^~~~~~~~~~~

taiko_controller:321:5: error: 'cc' was not declared in this scope

     cc = 0;

     ^~

C:\Users\dalla\Documents\Arduino\ArduinoTaikoController-master\taiko_controller\taiko_controller.ino:321:5: note: suggested alternative: 'cd'

     cc = 0;

     ^~

     cd

exit status 1

'ct' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

have I just installed something incorrectly?

LuiCat commented 4 years ago

It looks like your script is messed up when you accidentally pressed the keyboard somewhere in the Arduino IDE. If you don't know how to code, try to download the .ino file from GitHub and overwrite your local file.

Next time, make sure to UNDO or CTRL+Z for several times before upload, so that even if you did messed up the script, you still revert it.

LuiCat commented 3 years ago

Fixed