Compiling error

Status
Not open for further replies.

Aaron25th

New member
Trying to compile this

void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run repeatedly:
// press and hold CTRL
Keyboard.set_modifier(MODIFIERKEY_CTRL);
Keyboard.send_now();
}


For my teensy 3.2 and I keep getting this error

Build options changed, rebuilding all
myproject: In function 'void loop()':
myproject:10: warning: large integer implicitly truncated to unsigned type
Keyboard.set_modifier(MODIFIERKEY_CTRL);

^

C:\Users\user1\AppData\Local\Temp\build3a1ab46d62a84e3c71ee39b91f1d8aeb.tmp/core\core.a(yield.cpp.o): In function `yield':

C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/yield.cpp:43: undefined reference to `serialEvent()'

collect2.exe: error: ld returned 1 exit status

Error compiling for board Teensy 3.2 / 3.1.


I'm compiling with a usb type keyboard on teensyduino 1.29 beta 3
Help would be much appriciated if im doing something wrong or if i just need to change something. Thanks
 
It is a warning that the passed parameter is not the proper size for that function. Perhaps that is the wrong function to call - or the wrong way to use it?

That function wants an 8 bit value and the value being passed is 16 bits.

Usb_keyboard.h (teensy\avr\cores\teensy3): void set_modifier(uint8_t c) { keyboard_modifier_keys = c; }
Keylayouts.h (teensy\avr\cores\teensy3):#define MODIFIERKEY_CTRL ( 0x01 | 0xE000 )
 
I tried it here. I also see the warning, which is annoying but harmless.

But I can not get the error about missing yield. Here's a screenshot, so you can see it managed to compile here. I don't know why you're getting that error. :(

sc.png
 
Status
Not open for further replies.
Back
Top