Hey Guys -
I'm working on a project currently and have hit a roadblock. I've got an Arduino Nano which is doing quite a lot (from my perspective) thus not operating at the speed needed. After research, I did change how I lit the LEDs so it's sent directly to the port which saved a lot of cycles, but am wondering if I can go any further.
To note, when running code with just the 1st step below alone; values are read from the analog pin almost faster than I can read them in serial monitor. When all code is introduced, its read once every 2-3 seconds. I need it to update everything as fast as possible.
The current code is attached, but the loop basically consists of...
- Getting a value from an analog pin
- Does some math
- Checks rotary encoder state
- Lights some LEDs (depending on read values)
- Reads DHT22
- Writes value to servo
- Updates OLED display
If nothing dramatic can be done, any suggestions for a faster microprocessor would be appreciated. To note, it is needed in a tiny space, so the smaller; the better. It also would need to support at least 12 digital & 4 analog inputs. If nothing like that exists, at least I've learned a ton from this...
Note: I considered the MKR ZERO, then found out it only supported 3.3V per pin which would call for almost complete redesign of project so prefer not to use it if possible...
Thanks!
Real-PKE-ForumPost.ino (6.76 KB)