freddie43:
Thanks for the link to your website - I can see where I will be going when I get on to ESP 8266 and OLED - that’s the trouble with Arduino - as fast as I master one thing I get involved in something else. There is a steep learning curve out there!
<…>
Just to show how grey my beard really is, all my real time programming was in CORAL 66 and I was on the BSI committee which standardised it (BS 5905:1980). Since then I have used Pascal and Delphi, but only a tiny bit of C.
I strongly recommend the NodeMCU board programmed under ArduinoIDE using igrr’s core files installed by Board Manager from the JSON link.
The NodeMCU is going to run about $4 from AliExpress, but it has the USB-serial chip onboard. When the ESP8266 is programmed under Arduino, whatever firmware (Lua, AT, etc.) is overwritten by your compiled sketch plus the ESP proprietary library that supports the chip networking, etc. Said another way, the proprietary code runs in one time slice and the Arduino code runs in a separate time slice. The Arduino code must loop() every 50mS or less but if you have routines that take longer, you are responsible for using delay(0) or yield() to let the RF section of the chip have cpu time. It’s a weebit tricky, but you will get the hang in no time. (If not, the WDT will reboot to let you know you need to work on your Arduino sketch code :o )
The ESP8266 is so inexpensive, buy a few rather than just 1 or 2. You do not need to have a WiFi project to use the ESP8266 as a fast Arduino with lots of SRAM and flash. That is, you can disable the RF section power (but not the timeslice) and the ESP8266 will run as a fast Arduino, up to 160MHz.
Most NodeMCU boards are 4M flash modules which means you can configure 3M of the flash for a small file system using SPIFFS. This is a great place for storing lots and lots of strings, user instructions, page formatting, or formatted output.
OLEDs…
Be careful when you order, while the controller chip on the board may support both I2C and SPI, the physical pinout generally will only support one or the other. If 4-pins, it is I2C.
The price of the little OLEDs went up to about 2x or 3x the price in Spring of this year and stayed high most of the summer. Prices are now down to under $3 USD.
General note on purchasing from China. Beware Chinese New Year: January 28, 2017. The entire country shuts down for the occasion. Order taking, shipping, email notifications, etc. are all down a minimum of a week, but the ripple effect is more like 3 weeks. If you need a winter project, back-up the 6 week to 8 week (or longer) interval and order as early as possible… Now is a good time!
I programmed in COBOL a bit in the Burroughs’ days of 1973-1976. I also did some low-level MTR code on the L8000 series. Do yourself a favor, print this page from the Arduino Reference. When you are programming, the commands on this single page are Arduino abstractions. If you need to go to full C++ to accomplish what you need to do … go for it… but look up the syntax on the web first just to be certain you get the calling parameters and the variable types correct.
Oh, one big stinking thing:
When coding an 8-bit Arduino, INT is 16-bit
When coding a 32-bit Arduino, INT is 32-bit
Age has no bearing on how much fun you can have with this hobby. Do not get too serious. The young kids on the forum have come up through HTML and Java and are going to have a completely different way of looking at a problem. We older coders may have an advantage because we look at a problem as small steps because old machines had limited resources. Define your project and your budget (important.) Identify your hardware sources. Identify your software resources. Research libraries required and alternate libraries (in the event of conflict - it happens!) Always start a project by running the Arduino through a test suite … poor soldering often manifests itself in an open or shorted I/O. DO NOT assemble the entire project at one time!
Assemble the Arduino and the display and test.
Add sensors and test.
Add relays/servos/steppers and test.
Pull the project together as a system.
Because libraries often use interrupts, libraries can interact negatively. Some libraries poll while some libraries block which means that no matter how you code your loop, a call to a library that blocks can be a disaster. I always look over a potential library to determine if i understand what is really going on under the hood.
… and have fun.
Ray