So has anyone played with IR remotes and Teensy 3.1? I’m having a completely baffling issue, where code that works for lots of other people on the same board with the exact same libraries and the same remote just returns garbage.
Basically, it’s reading just “FFFFFFFF” as a response from the Sparkfun remote that I’m using.
Ninja Edit: for the hell of it, I compiled and uploaded the exact same sketch (the demo sketch, with one pin changed) on my 32-bit notebook, and bam, works as expected.
My desktop is 64-bit. What can I do to fix this?!
a) what pin - and b) are you doing anything other than the IR remote stuff?
(For laughs, try the demo sketch, but with the changed pin off of the 64-bit machine - I mean, I suppose it’s possible that the 64-bit machine is doing something to mess with your compiles/uploads, but that seems shady - plus, I’m running on a 64bit machine here - albiet running OS X)
Also - keep in mind, IR remote libraries want to use interrupts, and I Haven’t tackled the “interrupts don’t play nicely with WS2812 and friends chipsets” - so stick with the clock/data based led chipsets for now with IR remotes.
Using pin 16 rather than 11. Tried demo sketch on both - it’s the IRrecvDump sketch. 64-bit: failure. 32-bit, success. Someone in the arduino IRC suggested something about -m32 as a GCC compiler flag… but I have no idea how to deal with that. I guess 64bitness is causing the issue.
As for other stuff - Running a SD card, SmartMatrix/FastLED , and a temp/pressure module. Apart from silliness with the remote not being read properly, it’s all been smooth as silk. 
I think I need to switch up my IDE to something better. I’ve been using Sublime Text + Stino for a while, and it works, but it’s just not enough anymore. Time to look at Eclipse. I should be able to set GCC options there. I hope.
aaaaaand, that’s a gigantic fail - couldn’t even start a new project with Eclipse, much less open an existing one. Guess I have to do all my compilation for this project on my notebook if I want this to work.
I’ve been really happy with the free Visual Micro plugin for Visual Studio (https://visualmicro.codeplex.com). Unfortunately it doesn’t work with the free Express version of Visual Studio. If you try it, just make sure to follow their instructions for Teensy and set the “Defines - Project” property, or you’ll get lots of compile errors.
I use the Visual Micro plugin for Atmel Studio. Works like a charm. Granted, it uses all of the Arduino IDE’s hooks for libraries, headers, and compiler, but it’s a much nicer environment to work in, way better than the IDE itself. Speaking of, which version of the IDE are you using on both the 64- and 32-bit machines?
Exactly the same, Arduino 1.0.5 r2 w/ teensyduino (whatever the latest is). the only difference between environments is the bitness.
Also, same issues with Visual Micro - compiles are done on 64-bit, can’t seem to force it to use 32-bit mode.
From discussion on IRC and the PJRC forums, it’s a problem with how types are defined, there are a lot of non-specific ints and longs, which should be uint16_t or something. And I have no idea how to even start fixing that.
Huh, odd. Guess if I’m going to do any IR work (probably with that particular library) I’m screwed as every single one of my systems is 64-bit. 
Ah, changing those types isn’t too bad, just tedious. Essentially what you’re doing is changing anything that’s an ‘int’ to a proper type: int into int??_t and uint into uint??_t.
Signed ints are from -128 to 127, unsigned are from 0 to 255. (side note, for a lot of FastLED variables, use uint8_t as they only need to go from 0 to 255)
So
int8_t = -128 to 127
uint8_t = 0 to 255
int16_t = -−32,768 to 32,767
uint16_t = 0 to 65,535
int32_t = −2,147,483,648 to 2,147,483,647
uint32_t = 0 to 4,294,967,295
(the latter is also a long)
Basically 2 to the power of n - 1, where n is the amount of bits, 8, 16, 32, etc. So:
2^(n -1) to 2^(n-1)-1 - notice the max value is -1.
You can look at the code for the library and start changing those ints based on what their max values are.
well, I’ll try it. Wish me luck. 
Small correction:
signed ints are: −2^(n-1) to (2^(n-1)) - 1
unsigned ints are: 0 to (2^n) - 1
I’ve included stdint.h, and I’m getting a lot of “int8_t does not name a type”, for everything. uint16_t, uint32_t, and so forth.
Put that include at the very top … (and post your code on pastebin so we can see what could be going wrong)
Actually, I got it to compile finally, but it’s still giving me bad results. So I have no clue where to go from here other than compile on my notebook. Which is a pain.
Did you change the library as well? it’s not just your own code that needs changing, the actual library needs fixing too. Which means opening each one of it’s .c files …
oh, that’s what I was changing.
the demo code I test with doesn’t even declare types, just uses ones from the IRremote lib.
As a test, I’m copying the install from my 32-bit system to the 64-bit one, maybe it’s a straight compiler issue.
aaaaand, nope. Same issue. it’s “FFFFFFFF” all the way down, using the compilers from the 32-bit system on the 64-bit one.
Shouldn’t be, unless you installed different versions of it.