Newbie: "get started with Arduino IDE" guide?

Status
Not open for further replies.

XFer

Well-known member
Hello everyone,

I have my shiny new Teensy 3.2 attached to my PC, running Arduino IDE 1.6.5r5 (windows7-64).

I've installed Teensyduino 1.2.6beta1, along with USB drivers. I checked "Install all libraries" during the Teensyduino setup.

The very basic "Blink" sketch compiles, uploads and works without issues.

I'm now trying to get one of my Xbee sketches (originally developed for Arduino Mega 2560) up&running, but no luck.

Looks like Serial functions no longer compile; for example

Code:
static boolean checkSerialIsOpen()
{
  uint8_t i;
  
  if (!Serial1)
  {
    Serial1.begin(SERIAL_BAUDRATE); 
    i = 0;
    while ((!Serial1)&&(i++ < 100))  
    {   
      delay(SERIALDEBUG_DELAY_MS);
    }  
  }
 return true;
}

complains about:

Code:
no match for 'operator!' (operand type is 'HardwareSerial')

and this is just the very first error; I have a truckload of them ("Multiple SD libraries found" and so on).

I guess there's a "beginner Arduino programmer's guide to Teensy" out there, but I didn't find it. :(

Where to look for?

Thanks a lot!

Fernando
 
Last edited:
Until now I've never seen anyone actually use the bool operator for hardware serial. It always returns true, so there's not much point to testing it.

I've added it on github.
https://github.com/PaulStoffregen/cores/commit/7a6898b59d7206e0adb3334d1f2f45e640649e4f

If you want this fixed now, just grab HardwareSerial.h from github and put it into your hardware/teensy/avr/cores/teensy3 folder.

This will be in 1.26-beta2. My guess is Arduino might be preparing for a 1.6.6 release soon... so I'm holding off wrapping up 1.26 in anticipation of supporting 1.6.6 when it comes out.
 
Until now I've never seen anyone actually use the bool operator for hardware serial. It always returns true, so there's not much point to testing it.

Gosh. :eek: Of course you're right!
I've adapted that code from a Leonardo sketch which was using SoftSerial.
It compiled OK on the Mega so I didn't notice how absurd it was checking an HardwareSerial.

With the new HardwareSerial.h in place, I still get the compilation error (no ! operator found); but I axed the useless check so that part is OK now.
I still get a bunchload of errors (for example "Multiple SD libraries found"), but hey, one thing at a time.

Thanks a lot Paul!

Fernando
 
Status
Not open for further replies.
Back
Top