Changing Cameras Midway Through Code

Hi everyone,
is it possible to change cameras in the middle of your code (i.e having the rgb camera for say 20 seconds before moving to a greyscale one)?
Thanks!!

Yeah, just set the sensor pix format to grayscale and then skip a few frames.

So would it be something like:

sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA)   # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
while(time <20):
.......
sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) 
sensor.set_framesize(sensor.VGA)  
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
......

Yep!