-
Thoughts on Creating a Case
12/01/2021 at 00:40 • 0 commentsOne of the most challenging aspects I've found with creating physical things is making the case to put them in. This project will be the most challenging yet. I would like to model the case in CAD and 3D print it, but I don't have the skill for that right now. I also don't know how to go about getting industrial strength parts from 3D printing. The learning curve is just too steep for me at the moment. I am considering prototyping a case in something like epoxy putty, then making a mold of the case so I can cast resin parts. Glass fiber reinforced resin would be strong enough for what I need, and is easier for me to understand than most 3D CAD software. This is a device to be held in the hand, and I want it to feel natural. Modeling it by hand, then duplicating that model would be a very satisfying endeavor for me. I could possibly sell cases if anyone would be interested, or even build entire cameras and sell them to fund other projects and adventures. I do need to make some money eventually, sadly. I wouldn't be opposed to hiring someone to make a 3D model of the case and release that as open source after all of the bugs have been worked out. I see this camera as an every day piece of gear to do actual work with. It's a very niche concept that would be ideal for someone like me, but absurd to many people. I dream of being able to take a single device out into the field, in any conditions, and make videos with nothing but the camera, and perhaps a keyboard and mouse. I have multiple cases of camera gear just for the bare minimum video production set up, and it gets old having to drag it all around. I want this to look as professional as possible so I could use it for paying work without drawing negative attention. It would be fun when other professionals ask about the camera and I tell them I designed and built it myself. That would be an amazing feeling. The biggest downside right now is the HQ camera module being limited to 1080p resolution. I hope a 4K version releases at some point, that could be dropped into the case for this one.
Anyway, just writing out thoughts as I wait for a test video to upload for my Pi 400 Daily Driver project. Should be about done by now.
-
Redefining This Project
11/25/2021 at 16:55 • 0 commentsInitial Random Thoughts
I've decided no to give up on this project, but to change it up instead. I still have my camera module and lens, but need a Pi to use with it. I do have the new Pi Zero 2 W, but want more power. I plan to use a Pi CM4 with all the options in the official carrier board. It has dual camera interfaces, which could be really nice. I can't seem to find a CM4 for sale right now, so I will have to wait on the hardware.
The end goal is to have some sort of self contained video creation device I can take with me. Looks like a camera, edits and uploads videos on the side. I found the Pi 400 plenty powerful enough for video editing. I have an entire project for using the Pi 400 as a daily driver where I do my video editing tests as well. It's called Raspberry Pi 400 Daily Driver. I am too lazy to add a link right now, sorry. It's Thanksgiving Day here in the US and I am celebrating alone by working on my projects and cooking myself a nice dinner.
I suspect the most difficult aspects of this project are going to be software and the case. I want something that looks like a professional camera, but also actually works. I want it to be very reliable, so I may use a separate Pi to run the camera module and just dump the files onto a shared storage device that the CM4 could access. This way I could let a video render on the CM4 and still shoot footage using a Pi Zero 2 W. Getting the Pi hardware, massive battery, charging circuitry, data storage, lighting, and audio equipment into a nice looking case is going to be a challenge. I also want a nice touchscreen display on it and will likely go with the 7" display I've used before. The software shouldn't be too difficult, and I now have some experience with basic GUI design and programming. My first version of the camera software was command line and accepted keyboard input. I want keyboard input and touchscreen input on the final device.
Displays
The CM4 would open up dual DPI ports and allow me to use 2 of the official 7" touchscreens, if I am understanding this correctly. This would be perfect as one could be used as a viewfinder and the other as a teleprompter, which I use. If the HDMI ports are still accessible on top of this, I would have 2 more display options. his thing could end up being an incredibly versatile and useful general purpose computer. Getting all the displays to work in software might be a challenge.
Cameras
I plan to use the standard HQ camera modules for this project in the hopes that a 4K version will be released with the same form factor in the future. If so, I could upgrade to 4K and keep using this camera for many years to come. Right now I only have the one camera, but can get a second in he future.
Final Thoughts
I have many projects going on right now, but they are teaching me the skills needed to finish others, such as this one. I'd love to have this completed before I start my next round of travels and use it to record my journey. I will try to get it working before then, but won't stress if I don't manage it. Either way, I will still be using a Pi to edit my adventure videos. I really don't like most commercial camera offerings, so Pi it is.
-
Project Shelved: The Timing Isn't Right.
05/22/2021 at 15:00 • 0 commentsLately I've been consumed by just surviving day to day, and trying to get the camper restoration done. I live in that camper full time now, and have fore a few months. Things went south, again, and we had to move into it with very little notice. I ended up taking the camcorder apart to use the Pi and screen for a more important project: Controlling the camper's basic systems, such as the water heater, and electronics cooling system. I'll create a new project for that later and share the water heater system I have so far. It's got a basic GUI, USB communication from the Pi to the Arduino that controls the heating elements, and works good enough for daily use. I couldn't afford another Pi and screen since I am trying to save for our move to California. I may eventually scrap this entire project, hardware wise, but revisit the software as I still see a need for a good UI for the Pi 4 using the HQ Camera Module. If it doesn't exist in the near future, I'll pick this project back up. I'm getting mroe into video production these days, and will eventually want a fully programmable camera for things like motion sensing and wildlife filming. It's very hard to reprogram a standard camera, so an open source camera is a good tool to have. Hopefully I'll get some time in 2021 to finish writing the code and get it working. Right now, the current code will work for very basic functions. I have made some big breakthroughs in my programming journey, and am more capable than I thought I could be. Things are starting to click at last, and I should be able to come back to this project with far more skills and knock this one out for anyone else who might be interested. I logged in today in order to update the status of all my ongoing projects and work on one of them: Raspberry Pi GPIO Carts. I've had some thoughts on that and chosen a PCB fab house for prototypes and such. I find it very frustrating that life has crumbled so many times since this damn pandemic hit, and all of my personal projects were put on indefinite hold. I'm trying to make more time for them, but it's often at the expense of other things, like sleep, or bill money, or recovery time. The proects shall continue, come Hell or high water.
-
New Features: 12VDC input, LED Light, Code Updates
02/27/2021 at 04:38 • 0 commentsI've had this thing sitting, untouched for months now. My cousin surprised me with nice GoPro gear kit, which really motivated me to start a new YouTube channel and start work on this camcorder again. I've been very busy the past few months, and am surprised I got more work done on this recently. I'm about to move into a small camper and do the whole "Tiny Home Mobile Living" thing and needed a camera that does more than record wide angle stuff. I got a few new features implemented and made a few mistakes I will have to fix later. I got a DC power converter installed and hooked up. I can now run the Raspberry Pi 4, touchscreen, cooling fan, and light off of 12 volts DC, isntead of just USB type C. This is important to me as I have access to a 300AH lithium battery bank in the camper, and wanted to be able to hook directly into it. I also need 12 volts DC to run the led buld in the camera's light fixture. The convert can take in 12-24 volts DC and puts out about 5.3 volts DC at 15 amps. It's a very nice converter. The only problem is that I can't run the LED light with more than about 20 volts coming into the camera, as the LED is hooked directly to the input of that converter. I added extra current limiting resistors to the power line for the bulb, but the 20 volts from the drill battery was pushing the limits. I started the process of mounting 18 volt lithium Ryobi batteries to the camera, but had to walk away when connecting and mounting it became a massive pain in the arse. I still plan on finishing that, as it will make the camera truly mobile, but I just don't have the time right now. We are preparing to hit the road very soon. I just want this working well enough to take some nice B roll footage and goof around on the road with it. So far, I can record decent quality video, no audio, and have manual zoom and focus. I did confirm that the zoom and focus motors will work on 5 bolts DC, but they are a bit too fast. I think 3.3 volts would be better, but I really want to get motor drivers for them and be able to control the speed and direction of both with the Pi. I plan on implementing software autofocus at some point, assuming I can figure that all out. I need the hardware working first, so that's where that will begin. With those motors under software control, I could zoom and focus remotely, and even program it to zoom in at certain points in a scripted segment, if I wanted. Luxury features for the future.
The next thing I will do is open up the camera and re-adjust the lens. The focus is off because I must have rotated the assembly when I put it back together. It's almost ready to start making videos. So close.
-
Initial Button Setup
12/19/2020 at 04:00 • 0 commentsToday was a rather busy day. I spent most of it on the camper restoration. I took a break to get started on the camcorder buttons today though. I had an old Arduino Micro soldered to a protoboard in my hardware kit, and finally found a use for it: emulating a USB keyboard. It will read and denounce the button presses on the camcorder and spit out keyboard key presses to the Raspberry Pi running the camcorder software. So far I've only got the side buttons available as the top edge buttons had their momentary switches mounted to the main PCB that was taken out. It's a simple matter of soldering a row of buttons onto a PCB, mounting it under the outside buttons, and soldering on a connector. After the keyboard is made and programmed, the camera only needs a battery pack to be a stand-alone device. I'm considering mounting a USB battery bank inside the camera and building a connection on the back to accept Ryobi cordless tool batteries. We have half a dozen of those floating around already. After that, the only critical hardware missing is a microphone interface. The Raspberry Pi doesn't have an audio input at all. I find that rather annoying at times. In the end, I'll have a USB to XLR interface and proper mics.
If I remember correctly, the camcorder has 36 buttons and switches on it. I'll be adding more as I go for various things, and all will emulate keyboard button presses. A custom keyboard may eventually be made to control this camera. One of my IBM Model M keyboards will be the main keyboard for it once I get one of them working.
That's about it for this one. I may finish up the button mapping and coding for the keyboard tomorrow. If all goes very well, I'll have all the buttons hooked up and working.
-
New Feature Considerations
12/07/2020 at 04:05 • 0 commentsI've shown this project to two friends and each had a few ideas for future features. The first, whih I plan to implement immediately, is a dimmable LED flash. I already have the flash upgraded to LED, but it's only on or off. It's a standard LED taillight bulb for automotive use. 12 volts DC, probably about 1 amp current draw. I know that the GPIO pins on the Pi won't run that directly, so I found the Adafruit DRV8871 Motor Driver Breakout that should work nicely. My friend is an artist of many mediums, and immediately recommended dimming it for various lighting scenarios. I agree, so it shall be done. The flash module that mounts on top of the camera has 3 pins that it passes through. That's perfect for this. 1 will be 12 volts positive, another will be the ground, and the third will be the PWM signal. Couldn't have worked out any better than that. That PWM control should allow me to use the LED flash as a strobe light as well, which was another suggestion made to me.
Next is built in speakers for audio playback. I haven't looked at hardware for that, but it should be fairly simple. I'll be putting in an audio output for in ear monitors, and will just tie some powered speakers into that line. Will make gaming and video playback on the camcorder much easier, as I won't have to keep hooking up an external speaker.
A keyboard built into the lid that flips down to uncover the touchscreen. The space there is very limited, but I suspect I can get a grid of small momentary buttons mounted and use them for controlling functions outside of what the camcorder already has buttons for. I might even be able to fit an entire QWERTY keypad into it. Would make quick tasks much easier than plugging in or connection a keyboard. If I make that lid removeable and map the keys to main camera functions, it can be used as a hardwired control panel. That would help as the user wouldn't have to touch the camera in order to input commands, eliminating the chance of bumping the camera and shaking the image.
Along similar lines as the flip down keyboard, I'd like a built in LED light that would shine down on the keyboard. As much as I like backlights, I prefer the top mounted keyboard light on my Lenovo Thinkpad X230. Simple and very effective. I'll give the Pi control over that light so it can be turned off when the lid is closed, or when recording in low light situations where it might influence the image.
Interior light. I'd really like a little interior light that turns on when the case is opened to make it easier to swap memory cards, cables, or just work inside of it. Simple, but would be very helpful if I ever had to work inside the camera under less than ideal lighting situations.
Autofocus. This is a big one that will require some extra hardware. The camera has the motor and hardware to implement autofocus, and it used to use it quite well. It uses an IR system, but I think I'll go with a simpler image processing technique. The only thing I need for that is a Python library for autofocus, which I already confirmed exists. Once I get the motor wired up and under Pi control, I'll start on that software.Electric zoom control. THis camera also has a motor and hardware for the 24x optical zoon. I just have to give control of that motor to the Pi and map it to the original zoom buttons. Once this and autofocus are implemented, I can write programs to automatically zoom in and focus. This would be a great feature for when I don't have a camera operator and still need to zoom in and focus on a fixed point. Would be good for scripted work when I need the camera to zoom in on something I'm holding, then zoom back out after a set time. I've never heard of anything like this being implemented into a camera. I could make a fully automated studio where the host just follows the script and the camera does the rest. It's a large goal, but that's the end goal: single person automated recording studio built into a camera.
Pan and tilt motors. I plan to add Pi controlled pan and tilt on this, as soon as I decide on motors quiet and powerful enough to do it. The Open Sentry project comes to mind. It may be a sentry turret system, but we can just replace the gun with the camera and use that system to track motion and colors and pan and tilt the camera automatically. It would follow the action as you walk around.
Time Lapse. I plan to program in a time lapse mode that can be adjusted as needed. I will do many ime lapse videos, and don't like how limited my GoPro Hero 7 Silver is in regards to time lapse functionality.NAS. I'd like to have the secondary Pi act as a NAS that the main Pi will copy all video files to, so they can be offloaded from the camera wirelessly. Would just be a convenience feature for me, not really needed. I'm tired of copying files over USB and just want something easier, though it would be slower.
Audio only recording. Sometimes I'll just need to record high quality audio for voice over work and such. I would like to start creating my own stock audio and video collection, and that would just be another convenient tool.Motion sensors. I was thinking about all the game cameras out there, and how much wonderful footage they get. That made me realize I could add in a motion sensor and use it like a security camera or game camera. I'd have to figure out how to turn the IR filter on and off for this sensor and I'm not sure that's possible. If so, I could also add a night mode and add an IR flood light to the camera. Low priority, but a fun idea.
Wireless audio interfaces. I want to have wireless lapel microphones for this camera, and will have to figure out how to interface those. The Pi doesn't ave any audio inputs, so you have to use USB or I2S interfaces. USB can have good quality, and I know there are some nice XLR to USB interfaces. I plan on getting one of those. I can also get wireless XLR adapters and just plgu an XLR lapel mic into one of those. I;m new to much of the camera world, but slowly learning.There are countless features I can add to this camera, and it gets overwhelming. I'll start with basics, like getting audio to work. I've borrowed a Zoom H1 audio recorder from a musician friend. It Records to SD, has a line out, and can act as a USB microphone. I can't get it to work as a USB mic, and I suspect the USB cable is power only and no data transfer. I made sure the firmware version is 2.0 or higher(2.10), but it still doesn't work. I'll return to this later.
I'm done working on this tonight. Tomorrow is a new day(I need the power supply to charge my phone).
-
Overclocking the Pi
12/05/2020 at 19:12 • 0 commentsIt's my birthday today, and I decided to spend the morning doing chores, baking spicy dark chocolate gingerbread, and working on the camcorder. I've got a decent heat sink with fan taped onto the Pi right now(The adhesive for the thermal pad doesn't like to be vertical), and have it overclocked to 2.125GHz on the CPU and 750MHz on the GPU with an overvolt of 6. It's running just fine. I'm watching the temperature and CPU frequency while a stress test runs. Just using the simple stress program.
sudo apt-get install stress
Then to run it:
stress -i 4
That runs some sort of sync operation on all 4 cores of the CPU.
The temp started at about 30C, and is struggling to get past 50C. Hovering around 48C currently. The Pi should throttle at 80C, if I remember correctly, which means I have tons of thermal headroom. I doubt I'll overclock it much more. I do need a stable system, afterall. I overclocked it for dealing with mixing audio into the video stream when I get audio recording hardware. Another nice side effect of the overclock is better gaming and emulation performance. I might take the camcorder to visit my cousin with his giant vintage game and computer collection, and this would be a fun system to game on. Gaming on a camcorder...Never heard of that before.
I ran Super Tux Kart and Super Tux 2 for some game testing and to see how the Pi 4 might run games. Ran perfectly fine, even though STK warned of too low resolution and insuficient GPU stuff. More game stuff whrn I get back.
-
New Light, Pi Mounts, and OS
12/05/2020 at 05:59 • 0 commentsI stopped really working on this project when I cracked the SD card trying to get it out of the Pi. I didn't have a backup of the OS and all the stuff I installed to get my camcorder software working, so that was a big set back. I just have to remember exactly what modules where installed and how to install them. It should just be Pycamera and Keyboard for Python.
I started with Raspberry Pi OS Lite, but forgot that doesn't have a GUI... I would really like a GUI for this part. So I followed a prompt from the OS to run
sudo apt-get install lightdm
and that gave me a login window for Debian 10. That's perfect. Minimalistic OS installation with a light GUI. Couldn't get logged into it... The usual default user "pi" with password "raspberry" didn't seem to work. I think it was actually accepting the password because I never got an error like when I tried others. It just tried to load something and took me right back to the login screen. That was useless, so downloading the Raspberry Pi OS with Desktop now. That image is over 2GB, which is far too big for another project, but fine for this. This camcorder is a general purpose computer, so it should be just fine.
On a brighter note, I got the Pi mounted properly, and upgraded the old incandescent bulb on the camera to a very bright LED. The LED I'm using is a spare from the off grid camper project, and is meant to be a 12 volt car tail light. I managed to get it fit perfectly into the little case that mounts to the top of the camera. I'll wire it later, but initial testing shows that it's a far better light, with a very bright white, instead of the dim yellow light.
For the new Pi mounts, I melted 2 holes into the plastic case with an ice pick and screwed in two motherboard standoffs. As the other mounting holes sat up on a little plastic hill, I had to do something different. I took some long screws that I have nuts for, heated them with a small torch, and sunk the screw heads into the plastic and quickly dropped the Pi into place to align them. Then I screwed a nut onto the screw for the Pi to rest on. It's very sturdy and another nut on top of each screw will secure it permanently. I trimmed away a little plastic on the camcorder case to gain access to the Pi ports, and it worked perfectly. The only thing I can't access right now is the SD card(not using it, booting from USB), and the GPIO, which I can break out later or wire internally.
I've finally gotten the camcorder booting again, on the latest Raspberry Pi OS. All of the hardware and software actually worked on the first try this time around. USB booting works great and the system is very useable. I'm using a 32GB Samsung USB 3.1 flash drive for the boot drive. It's the nice metal one. It's my standard flash drive these days. I tried running my camera software, but forgot I had to install the keyboard software with "pip3" instead of "pip":
sudo pip3 install keyboard
The above installed the keyboard module and it seems to be working. I didn't have the camera interface enabled, so I had to change that up. After enabling the camera interface and such, my camcorder software started right up. I didn't have the latest version backup up, so the photo mode was missing, as well as all exposure and ISO adjustments. Easy enough to implement. I ended up adding a bunch of new features to the camcorder software over the past hour or so. I can now control ISO, exposure(only Night and Auto modes currently), and I can finally toggle the preview. The preview is a nuisance at times, as it covers all of the screen and I can't tell what the camera is doing. I also added print() output for all functions of the camera so I can see what's going on. Everything is working very well on video, and I can capture images. A big problem is how long it takes to save an image at full resolution. It seems to take a very long time to caputre the image, and the camera becomes unusable as it does so. I will add in a feature to capture an image at current video resolution that will not interfere with video recording, then have a special camera still mode programmed in later. It's all very basic right now, but it's working better than ever, and I've gotten new features working on the first try, which is new and a great sign that I'm making much progress in my programming.
I spent some time trying to clone the USB boot drive for the camera, but got stuck and set that aside to program more features. Tomorrow is my birthday, and I may be spending it with my cousin who has a giant vintage game and computer collection. The camera is now ready to go mobile, and I'll take it with me so we can play with it and maybe install emulators and game on the camcorder.
In the future, I believe I'll install a second Raspberry Pi 4. I want a very powerful and capable Pi to capture video and mix in the audio, and I don't think the Pi Zero W I have will be powerful enough. An overclocked Pi 4 should do it. The other Pi 4 in this camcorder will be used for managing files, editing, compression, and whatever else I need it for.
Right now, this camera is well on it's way to becoming a fully featured camcorder. I'll be building a custom control board for it when the build is complete, so that all features can be quickly accessed on a custom board, if needed. This camera will function more like a bradcast camera than anything else, with the ability to do on the fly editing, mixing, overlays, compression, and whatever else may need done. The goal is to have one device that can do it all on the go. I know I have to sacrifice quality to achiece that goal, but it will give me a fun camera to use and learn the ropes with. It's my most successful project yet, and it just keeps getting better.
-
New Feature: One Button Record and Stop
11/30/2020 at 18:53 • 0 commentsI decided it was time to finally start cleaning up my code this morning, and it's going surprisingly well. I created some basic functions, and basically started over. I finally got a function working that lets me start and stop recording by pressing a button. It's a rather important feature, as it lets me use the single physical record button on the camcorder. The current code is still quite messy, but I'll post it here anyway.
It works just fine, and lays the foundations for easily implementing the rest of the features later.
Features previously implemented, but not yet implemented in this iteration:
- Photo captures
- White balance adjustments
- Exposure adjustments
- ISO adjustments
Improvements in this iteration, over previous:
- One button record and stop
- Cleaner code, allowing for faster future coding
The code is at a point where someone could install my setup into their Raspberry Pi and have a working camcorder. It's quite easy to make simple scripts that would capture a video file, but I feel mine is a more complete solution than that. It's getting to a point where it would be a useable system for the average person, once installed. No running of scripts and such. Just pressing buttons and pointing the camera. The end goal is a working camera that takes advantage of every single feature of the Raspberry Pi HQ Camera Module, as well as many of the general purpose features of the Raspberry Pi 4.
I have to go clean the car out and such, so back to the real world for a little bit.
The following code is known working at this point, but using it requires the Keyboard module installed.
#Commands: #r = start recording #p = take picture #0-8 = ISO modes 100-800, 0 is auto #a = auto exposure #n = night exposure #Exposure Modes: #- off #- auto #- night #- nightpreview #- backlight #- spotlight #- sports #- snow #- beach #- verylong #- fixedfps #- antishake #- fireworks #White Balance Modes: #- off #- auto #- sunlight #- cloudy #- shade #- tungsten #- flourescent #- incandescent #- flash #- horizon import time import keyboard from time import sleep from picamera import PiCamera camera = PiCamera() camera.resolution = (1920, 1080) camera.exposure_mode = 'auto' camera.awb_mode = 'auto' #camera.start_preview() print("PiCorder V1.4") def record_start(): camera.resolution = (1920, 1080) sleep(2) camera.start_recording('/home/pi/Documents/test_files/button.h264') print("Recording Started") while True: if keyboard.is_pressed('r'): record_stop() print("stop") time.sleep(1) break def record_stop(): camera.stop_recording() print("Recording Stopped") def end(): camera.stop_preview() camera.close() print("Killing Program") time.sleep(2) while True: try: if keyboard.is_pressed('r'): record_start() if keyboard.is_pressed('x'): end() break except: pass
-
New Feature: Exposure Adjustment
11/30/2020 at 04:37 • 0 commentsIn the previous log, I said I'd implement white balance next...I Lied. I ended up doing exposure adjustment instead. It was easy enough to add "auto" and "night", so I'm happy with that. Feature implementation is turning out to be one of my favorite parts. I suspect that's pretty common with most people... I do make myself go back and clean up and optimize my code after a while, but it's more of a chore. Speaking of which, I need a better system for adjusting all of these settings, as I won't have that many physical buttons on the camera. That reminds me: I need to count how many buttons I have available on the thing. I'm sure I'll add more as I go. 23 tactile buttons, and 2 sliding swithces. One switch is the power switch, two buttons are reserved for zoom, and a 1 is the record button. That leaves me a cool 20 buttons to work with right now. I counted 36 current options that require buttons, so I already far exceed what I have. Being able to scroll through functions and save commonly used as hot keys will be a requirement at this point. I need to combine the buttons to start and stop recording into a single toggle button, which will free up one button. Using a keyboard, it hardly matters how many things I tie to buttons. Maybe I'll have the option to hook up a full keyboard and unlock every single function. I giant custom control panel comes to mind, and looks glorious in my head. It makes me happy to imagine breaking out every single camera function onto a control panel, and running this like a brodcast camera. Broadcast camera is loosely what I am basing this on, so that makes perfect sense.
Anyway, back to the actual update. The following updated code is working as designed, and all is well at this point. I finally docuented all of the commands in the file, as they were starting to pile up. I feel the documentation process is one of the most important in the creation process, but it can be very time consuming and tedious up front. Worht the savings down the road, and when others wish to work with your code.
""" Commands: r = start recording s = stop recording p = take picture 0-8 = ISO modes 100-800, 0 is auto a = auto exposure n = night exposure Exposure Modes: - off - auto - night - nightpreview - backlight - spotlight - sports - snow - beach - verylong - fixedfps - antishake - fireworks White Balance Modes: - off - auto - sunlight - cloudy - shade - tungsten - flourescent - incandescent - flash - horizon """ import keyboard from time import sleep from picamera import PiCamera import numpy as np camera = PiCamera() camera.resolution = (1920, 1080) camera.exposure_mode = 'auto' camera.awb_mode = 'auto' camera.start_preview() while True: try: if keyboard.is_pressed('r'): camera.resolution = (1920, 1080) sleep(2) camera.start_recording('/home/pi/Documents/test_files/button.h264') if keyboard.is_pressed('s'): camera.stop_recording() if keyboard.is_pressed('p'): sleep(2) camera.resolution = (2592, 1944) camera.capture('/home/pi/Documents/test_files/testpic.png') camera.resolution = (1920, 1080) camera.start_preview() if keyboard.is_pressed("n"): camera.exposure_mode = 'night' if keyboard.is_pressed("a"): camera.exposure_mode = 'auto' if keyboard.is_pressed("0"): camera.iso = 0 if keyboard.is_pressed("1"): camera.iso = 100 if keyboard.is_pressed("2"): camera.iso = 200 if keyboard.is_pressed("3"): camera.iso = 300 if keyboard.is_pressed("4"): camera.iso = 400 if keyboard.is_pressed("5"): camera.iso = 500 if keyboard.is_pressed("6"): camera.iso = 600 if keyboard.is_pressed("7"): camera.iso = 700 if keyboard.is_pressed("8"): camera.iso = 800 if keyboard.is_pressed('x'): camera.stop_preview() break close() sleep(.01) except: pass