Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My IDE shows, "Error compiling" when trying to verifiy my code. #11

Open
Pastyguy opened this issue Jun 9, 2015 · 7 comments
Open

My IDE shows, "Error compiling" when trying to verifiy my code. #11

Pastyguy opened this issue Jun 9, 2015 · 7 comments

Comments

@Pastyguy
Copy link

Pastyguy commented Jun 9, 2015

I'm using the trinket to as a keyboard(trying to at least), but my problem is just with the IDE. I try to install the the library by sketch>inlcude library>add .zip then returns all clear.
Problem occures when i try to varifiey the code it, and it returns with this error message

"Arduino: 1.6.4 (Windows 7), Board: "Adafruit Trinket 8MHz"

Build options changed, rebuilding all

TrinketKeyboardExample.ino:6:29: fatal error: TrinketKeyboard.h: No such file or directory
compilation terminated.
Error compiling.

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

My code from the library im trying to load.
"
/*
TrinketKeyboard example
For Trinket by Adafruit Industries
*/

#include <TrinketKeyboard.h>

#define PIN_BUTTON_CAPITAL_A 0
#define PIN_BUTTON_STRING    2

void setup()
{
  // button pins as inputs
  pinMode(PIN_BUTTON_CAPITAL_A, INPUT);
  pinMode(PIN_BUTTON_STRING, INPUT);

  // setting input pins to high means turning on internal pull-up resistors
  digitalWrite(PIN_BUTTON_CAPITAL_A, HIGH);
  digitalWrite(PIN_BUTTON_STRING, HIGH);
  // remember, the buttons are active-low, they read LOW when they are not pressed

  // start USB stuff
  TrinketKeyboard.begin();
}

void loop()
{
  // the poll function must be called at least once every 10 ms
  // or cause a keystroke
  // if it is not, then the computer may think that the device
  // has stopped working, and give errors
  TrinketKeyboard.poll();

  if (digitalRead(PIN_BUTTON_CAPITAL_A) == LOW)
  {
    // this should type a capital A
    TrinketKeyboard.pressKey(KEYCODE_MOD_LEFT_SHIFT, KEYCODE_A);
    // this releases the key (otherwise it is held down!)
    TrinketKeyboard.pressKey(0, 0);
  }

  if (digitalRead(PIN_BUTTON_STRING) == LOW)
  {
    // type out a string using the Print class
    TrinketKeyboard.print("Hello World!");
  }
}

"

Id really appreciate the help. Thanks!

@MarkMcKinney
Copy link

I am having a similar issue although this one pertains to the TrinketFakeUsbSerial library. I use the exact same demo code displayed in the tutorial however I receive this error:

In file included from C:\Users\Mark\Documents\Arduino\libraries\TrinketFakeUsbSerial\usbdrvasm_includer.S:24:0:
C:\Users\Mark\Documents\Arduino\libraries\TrinketFakeUsbSerial\usbdrv/usbdrvasm.S:17:0: warning: "__SFR_OFFSET" redefined [enabled by default]
#define __SFR_OFFSET 0 /* used by avr-libc's register definitions */
^
In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,
from C:\Users\Mark\Documents\Arduino\libraries\TrinketFakeUsbSerial\cmdline_defs.h:26,
from C:\Users\Mark\Documents\Arduino\libraries\TrinketFakeUsbSerial\usbdrvasm_includer.S:22:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\sfr_defs.h:141:0: note: this is the location of the previous definition

define __SFR_OFFSET 0x20

^
In file included from C:\Users\Mark\Documents\Arduino\libraries\TrinketFakeUsbSerial\usbdrvasm_includer.S:24:0:
C:\Users\Mark\Documents\Arduino\libraries\TrinketFakeUsbSerial\usbdrv/usbdrvasm.S:384:34: fatal error: usbdrvasm16.inc: No such file or directory

include "usbdrvasm16.inc"

                              ^

compilation terminated.
Error compiling.

@elwin1234
Copy link

I also had this error for the TrinketFakeUsbSerial library. Seems that only the usbdravasm165.inc file is included in the package. Downloaded the file from https://raw.githubusercontent.com/digistump/DigisparkArduinoIntegration/master/libraries/DigisparkKeyboard/usbdrvasm16.inc

However, now I get:

In file included from /home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrvasm_includer.S:24:0:
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/usbdrvasm.S:17:0: warning: "__SFR_OFFSET" redefined [enabled by default]
 #define __SFR_OFFSET 0      /* used by avr-libc's register definitions */
 ^
In file included from /usr/share/arduino/hardware/tools/avr/avr/include/avr/io.h:99:0,
                 from /home/elwin/Arduino/libraries/TrinketFakeUsbSerial/cmdline_defs.h:26,
                 from /home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrvasm_includer.S:22:
/usr/share/arduino/hardware/tools/avr/avr/include/avr/sfr_defs.h:141:0: note: this is the location of the previous definition
 #    define __SFR_OFFSET 0x20
 ^
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/asmcommon.inc: Assembler messages:
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/asmcommon.inc:44: Error: constant value required
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/asmcommon.inc:60: Error: constant value required
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/asmcommon.inc:97: Error: constant value required
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/asmcommon.inc:98: Error: constant value required
/home/elwin/Arduino/libraries/TrinketFakeUsbSerial/usbdrv/usbdrvasm16.inc:333: Error: constant value required
Error compiling.

@MarkMcKinney
Copy link

Hmmm... are you using the Pro Trinket or just the regular Trinket? If you're using the pro, you have to actually use FTDI. That was my problem, don't know if it's yours too.

@elwin1234
Copy link

Hi,

Thanks! Yes, I also found that it worked using the trinket and not with the trinket pro. Thanks for the FTDI tip.

@allyourcode
Copy link

@Pastyguy Looks like you haven't installed the library correctly. Make sure there is a TrinketMouse directory in your libraries directory. README.md mentions this very briefly. A more detailed explanation can be found here: https://www.arduino.cc/en/Guide/Libraries#toc5

@alprokofev
Copy link

alprokofev commented Jan 19, 2019

I downloaded the library and try to run it, and did not make any changes in the code.
I receive this error:
C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc: Assembler messages:

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc:98: Error: constant value required

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc:43: Error: invalid operands (ABS and UND sections) for `<<'

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc:59: Error: invalid operands (ABS and UND sections) for `<<'

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/usbdrvasm16.inc:332: Error: invalid operands (ABS and UND sections) for `<<'

Id really appreciate the help

@iskandarsyah0580
Copy link

Did you manage to find the solution?

I downloaded the library and try to run it, and did not make any changes in the code. I receive this error: C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc: Assembler messages:

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc:98: Error: constant value required

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc:43: Error: invalid operands (ABS and UND sections) for `<<'

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/asmcommon.inc:59: Error: invalid operands (ABS and UND sections) for `<<'

C:\Program Files (x86)\Arduino\libraries\TrinketHidCombo\usbdrv/usbdrvasm16.inc:332: Error: invalid operands (ABS and UND sections) for `<<'

Id really appreciate the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants