I have created a program on a Mega 2560 to coordinate 3 inputs, a colour 1336 OLED display (96x64) and 6 channels of LED strips. The buttons control the program that's running and the LED screen provides info on the current and next programs.
I wont post all of the code as it's huge, but the setup bits are below. I only update the parts of the display I am changing to keep the timing down, but the refresh is SOOO slow! (up to 2 seconds depending on what's changing). As the processor is supposed to be running the dynamic patterns to the LEDs, it is interrupting that process.
Grateful for any thoughts. I have tried hardware and software SPI, but doesnt appear to be any difference.
Hi Delta_G, thanks for your reply. Slightly confused by your post - I cant see anything that has changed!
Delta_G:
Here's the setup part for the code that you need. This will run a lot faster. I left out the same parts you left out since you said they aren't important. Though I am a bit confused because that's where all the timing issues pop up. But if you say you can get it from just this part then I guess that's all you need.
Thanks for taking the time to reply. So I think the hardware solution is supposed to be faster right? I had just commented that out to try the software version. Will the pins I had listed above work with the hardware SPI option? My understanding was that to activate the hardware version, simply use this:
Thanks Delta_G. I had just assumed it was a setup issue... here is an example of just inverting the colour of a small part of the screen. Takes just under a second for a small rectangle.
Sorry Delta_G, hadnt picked up on the sarcasm on the first post, but definitely got the hint on the second.
Sadly I can't post all of the code publicly, so was hoping to gain some insight from those with experience, purely based on the initialisation and the way I am writing to the screen. I'm relatively new to this so was seeking assistance from those experts on this forum that kindly give their time to helping those like me (thank you!).
I totally get that you dont want to engage if it's not a full program though, so thanks for your inputs this far.
I think that the OP was worried about message size when pasting to a CODE window.
You can always attach a file. Or better still, attach a ZIP of a complete project.
I don't think anyone minds answering a technical question.
It is your job to create the smallest (non-commercially sensitive) code that exhibits your problem.
Then a reader can replicate it for herself.
If you make the effort to ask your question well, you get a good response from your readers.
And often a solution in the first reply.
Delta_G - there is no commercial / profit / derived benefit from it, however I know there is someone trying to do something similar with not such good intentions. Hence my reasoning behind not posting the whole code. You have jumped to a conclusion that is not the case.
Thanks david_prentice - changed the pin out for the reset, and made it back to hardware SPI. sadly no change. Out of interest, what sort of frame rate would you expect.