quick questions

Status
Not open for further replies.

Francois

Member
i have few questions about the Teensy 3.1.

I was looking at the PulsePosition.h library, and noticed few things that I do not understand:

1 - There is a Serial.print(val); but no Serial.begin(9600); . How does it work?

2 - I can use val = analogRead(0); without declaring the pin pinMode(0, INPUT);. Isn't necessary to declare the pins before use ?

3 - What is Vbat?

4 - Can I power the teensy though regulated 3.3V on the 3.3V pin?

Thank you,

Francois
 
I just checked the library, there are no Serial.begin() ... I am a little loss (It's not a big problem, and everything is working fine!)
 
That's normal, you import the library in your sketch and if you want some debugging information you call Serial.begin in the setup section of your sketch. If you don't call Serial.begin then those statements will be ignored in the library.
 
Teensy has never required Serial.begin(), because the USB connects by default. Serial.print() sends to the USB, which ends up in the Arduino Serial Monitor. It always communicates at full USB speed, so the baud rate number is ignored.

However, for Serial1, Serial2 and Serial3, which are the real hardware serial ports, you do need begin(baud) to set the baud rate.
 
Status
Not open for further replies.
Back
Top