Can you use both the 3.3V and 5V simultaneously?

On an Arduino Mega can you have a 3.3V sensor connected and a 5V sensor connected (so using both the 3.3 and5v pins simultaneously) and both in the same sketch? Both independent sketches run on 9600 baud.

Yes, both the 3.3V and 5V pins will have those voltages all the time. They don't turn on or off.

So I can run two different voltage sensors at the same time? If so, couldn't I also do this on a Uno?

dier02:
So I can run two different voltage sensors at the same time? If so, couldn't I also do this on a Uno?

Yes.

Hey G, but to do that and get full resolution out 3.3v sensor coming in, you would have to alter the Aref pin right? And then doesn't that change the ref voltage to all input pins? (we're talking Uno only here)
Is there a trick to get full resolution out of both 5 and 3.3 sensors at the same time on the UNO? (assuming no external circuitry).

Otherwise while the 5v sensor will top out at 1023, the 3.3 top end will be in the 614 neighborhood.

Ok I just realized I might have misinterpreted dier02 - are they external sensors testing the voltage of the 3.3v out and 5v out pin?
Or a 3.3 v based and 5v based sensor (like a thermistor or light detector) connected to two analogInput pins. My question was assuming the latter.

Don't know. The OP hasn't said what sort of sensor we are talking about. If it is something with an analog output then it would need a different AREF to get full resolution. But if it is something with a digital output it might just need a level shifter or nothing at all. The OP hasn't provided ANY details about what they are actually working with so all we can ever give them is basic generalizations.