I'm writing a program for the pi I need to know if the user uses a pi cam v1 or the V2 is there a known way to tell the difference. I don't mind going low level (c or c++) if I have to
You can get the revision number by this Python code:
import picamera with picamera.PiCamera() as cam: print(cam.revision)
revision returns a string representing the revision of the Pi's camera module. At the time of writing, the string returned is
ov5647 for the V1 module, and
imx219 for the V2 module.