Saturday, February 13, 2021

Taking A Stand For Civilization

Well, this is it. I can no longer sit by idly and watch all that our forefathers have built be brought to ruin. When our invertebrate ancestors crawled out from the slime and worked themselves to the bone, evolving into primates, they did not do so that we might turn and crawl back into the slime.

I will not, nay, I cannot use an Arduino board to capture time-lapse photography.

There, I said it. I may be fired from my job on Tuesday when this comes out, but it's a small price to pay when others have paid so much for me. The bold nematodes, the courageous flatworms, even the noble nautili, their sacrifices must not have been made in vain.

Ahem.

I figured out how to take individual shots using my ArduCAM attached to my Arduino Uno board. I had struggled mentally with the project until I realized that the code I wrote and uploaded to the Uno was ... running on the Uno.

That's why it was uploaded to the Uno. To run there. On the Uno.

I had puzzled over the portion of the code reading the serial port and waiting for something to appear there. How was it that the camera would put something on that port to be read? Then it dawned on me that the code was reading the serial port waiting for my computer to send a command to the board. The board was reading its port. It wasn't the computer reading its.

Once I figured this out, I found a computer-side app to send commands to the waiting Uno/ArduCAM hybrid. The Uno dutifully took pictures and sent them back to the computer. Slowly. Very, very slowly.

The Arduino talks to you via a serial port. When it takes a photo, it is reading the pixel array off the camera as fast as it can and sending the results to you. That's not very fast. Consequently, if there is motion in the frame, you'll get blurring. You can reduce the blurring by reducing the resolution, but shooting in 320x200 isn't going to satisfy my needs. I want to capture clouds and sunsets as well as stationary plants with this thing.

Finally, the code itself is made for savages. You are setting individual pins high and low. Ugh. I might as well be using a chamber pot and digging for tubers with a stick. digitalWrite(CS, HIGH) is no way for a gentleman to behave.

So I'm off to find out if a RaspberryPi or perhaps some kind of Chrome computer would do the trick. I'm a decent Javascript and PHP programmer and I'd much rather be working in those languages than barking things like 'ACK CMD ArduCAM Start' at myself through a serial port.

My worthy friends, I will not dishonor your contributions to my life by wallowing in the filth of Arduino programming.

Update: The RaspberryPi looks perfect. It's no more expensive than an Arduino and you can program in Python. I don't know Python, but it's going to be a darn sight easier than carving Arduino totems with a stone knife.

2 comments:

Foxfier said...

*grins*

Mostly Nothing said...

I have a number of Raspberry Pi boards. A 3, a 4, and 2 or 3 Zero W.

I recently converted the 3 and 4 from Raspberry Pi OS to Ubuntu. It gave be 64 bit on both, and got rid of the Microsoft repo.

The Zero W is probably more that fine for what you want, nice and small. Though it doesn't come with the pins in the interface. It is 32 bit only. And a pretty old CPU, so they are slowish.

I learned a little python a year or two ago. It's ok, I like that it forces indenting, since I have learned to loath other peoples' code. But it has lots of weird stuff too. My son has been on a kick learning python and django. Bringing up a web app.

I'm thinking of another 4 with 8gig, and running VMware on it. Because I can.