ESP32 CAM - EEPROM / sdcard / non erasable memory - beginner problem - arduino

Overwiew
I am working on my first project with ESP32, I have ESP32 CAM model and I am creating an automatic roller blinds. I got most of the project working - I have web server that controls continous servo and all mechanics. I want to be able to adjust the time for going up-down without reprograming the microcontroller. The goal is to have an automatic roller blinds with alarm clock function.
Problem
I need a way to reliable save/read data to store variables state, even without power. How to achive it with ESP32 CAM?
Additional info
On Arduino board that would be EEPROM, and I found some tutorials that claim that EEPROM can be used on ESP32. However, when I tried using EEPROM, it looks like the values are overwritten while bootloading. So I guess ESP32 CAM needs different approach. Correct me if I am wrong, please.

Ok, so user bvguy on Reddit solved my problem.
"EEPROM is deprecated. They want you to use preferences now. Here is an example ."
I tested the example and it works on my ESP32 CAM, therfore solving the problem.

Related

Putting my raspberry pi program on a more primitive chip

I recently started coding on a raspberry pi. I build a circuit with three buttons, an LED and a 7 digit LCD. Its a fairly simply thing. You can set a time value with the + and - button in seconds and then press the other one to start a countdown. I use this to do triggered long exposures with my camera. However the raspberry pi is to big and bulky and needs to much energy.
Then I put my code and my circuit on an Arduino UNO which is an improvement in size and energy consumption.
Because my program is very simple I am sure that there must be a way to get this on a much smaller chip. I need some kind of programmable chip where I can put my code onto. Something that is small and dont has any other fancy features or more calculating power than I could need. As far as my knowledge goes I dont have any idea how to get into that.
At work we have a 3D printer with a W1209 temperature relay controller on it. This is a small circuit with the same 7 digit LCD pane and the temperature is also settable with two buttons. This inspired me to look for something much more primitive that would be enough for my needs.
Can you recommend any hardware or some tutorials about that?
Search the Microchip website for the DM164141 - MPLABXpress PIC16F18345 Evaluation Board. I think it's around $12 and should have enough I/O for your application. You can use the online MPLABXpress IDE for development.

Why do we need to select a board to work with arduino IDE

I always wondered how this works . In arduino IDE we have option to select different boards because the code upload i guess is different ? Also there is possibility to even add board manager url to add other boards.
Why uploading the code is so different from board to board , and what exactly differs there ? The code is sent to via serial connection and i understand that a board might have different chip for handling USB to serial but ..
Can someone explain as clear as possible , how the code is uploaded to a board and why there is no generic way , why so many configurations.
Thanks and sorry if is a dumb question.
One of the important things that selecting a board does is, as you say, inform the IDE of how to load code onto the board. Perhaps more importantly, the board definitions give you the logical mapping of the board's hardware to the code constructs you are using to program against. For example, have you ever wondered what happens when you use a constant like PIN_13, or how that constant maps to a physical pin on your board, which has a trace to some contact on the microcontroller chip itself?
There is a lot of other code you don't see, much of it in the board definitions (and some in the Arduino core) which lets you work with relatively direct concepts (like pin numbers and modes) in the code that you write or edit.

FREEDOM K64F Low Power Timer LPTIMER usage and configuration

i'm trying to manage some pulse width measurements with my FRDM K64F board, but everithing seems very difficult. Firstly i'm working on IAR embedded workbench and a RTOS micrium uC/OS, secondly i have some constraints like the usage of the LPTIMER and interrupts. My background is based on PIC 8bit microcontrollers.
How do i have to start working?
On the datasheet there is no reference on any pinout or other helpful information, do you have some tutorial or guidelines?
thanks really so much.

Need to bootload multiple times when using Nick Gammons program

I have been facing this issue with Nick Gammon's Arduino boot loader that every time I bootload and write a program via Rx-Tx to an Atmega 2560 but if I want to re write another program the IDE shows an error and the whole process has to be repeated, is this normal behaviour?
Its sort of an issue as I am programming an LCD and need to make lots of small changes.
TIA.

qr code decoding on uC

i am working on a project that uses qr code to check in guest at an event. i intended to implement it as a mobile app on android but my professor require a hardware element to the project. so my question s are
can i do decoding of a qr-code image on a microcontroller with a CMOS camera and which one is recommended?
if not, is it possible to use a cmos camera with a microcontroller to take the picture and send it to a pc to do the decoding and which microcontroller is recommended?
any other suggestion will be appreciated
I wouldn't try to decode QR Code with something less powerful than ARM.
Ad 1.
Of course you can, but, as I said, I wouldn't try on something less powerful than ARM (unless you're a C ninja and you can fit into, say, AVR for this task).
Decoding QR code itself isn't that hard and I you'll be able to write it by yourself (or use existing library).
Ad 2.
You'll need some connectivity to do that. There are many Bluetooth, Ethernet and WLAN boards around (in my experience, best choice may be Bluetooth, you may get away without implementing network stack).
Useful link.
Decoding QR codes is relatively easy as barcodes go. You can use source code from the ZXing library, running on the server side (it's primarily Java) to do the decoding. Decoding is "fast"; on the original Android (ARM7) devices it would still decode in about 100ms.
But I think your question is about image quality. I am not familiar with the output of CMOS sensors, but for QR codes, you don't need color data and you don't need much resolution (240x240 works for most QR codes). If anything the issue is focus.

Resources