Now set your flash to auto. You can then take a few pictures, switch the camera back and forth, turn HDR on and off, but make sure the flash is set to auto before you unlock the iPhone.
4. Reset all settings
Try and reset settings on your iPhone, this won’t delete your photos, messages, contacts, and other data in your iPhone, but only remove all your iPhone settings.
To do this go to Settings -> General -> Reset -> Reset All Settings. The iPhone returns to default settings. Open Camera again to check whether you can take photos now.
It should work, but if it fails take it to the nearest Apple store, if you have a warranty they will change it.
Note: Works for iPhone 7, iPhone SE, iPhone 6S, iPhone 6S Plus, iPhone 6, iPhone 6 Plus, iPhone 5S, iPhone 5C, iPhone 5, iPhone 4S, iPhone 4, as well as iOS 10, iOS 9.3, iOS 9, iOS 8, iOS 7, or iOS 6.
If all this doesn’t work change your flash.