Arduino-Project-Planning-Code

From ArduinoInfo
Jump to navigation Jump to search

Arduino-Project-Planning-CODE


FIRST THOUGHTS From Terry

This is a great subject.

Somewhere between 16 months of Analysis Paralysis and Rewriting All The Comments on an IBM project in 1993, and "Agile Programming" (whatever that actually is), I have come to believe there is a friendly place we can live in.

My basic belief is "Prototype Everything": Interaction Design, Hardware, Code, Documentation, packaging.

I wrote a lot of PASCAL back in the day, and I have used Niklaus Wirth's concept of "Stepwise Refinement" ever since.

And don't get too bogged down in other people's ideas, and what they say is "The Right Way". Including mine.

I was fortunate to be able to help get Buckminister Fuller to come and talk with us at IBM. One thing he said has echoed in some space in my head ever since:

FullerNaive.jpeg

FORUM DISCUSSIONS:

Here is a VERY good and VERY detailed example of developing code one step at a time, by "Robin2" who has contributed much to Arduino knowledge. ROBIN2: Planning and Implementing an Arduino Program

And this from PAULS: Two things I do:
1) Print every function. Anything that takes more than one page is too long.
2) Use lots of functions. Every function should have a name that clearly describes what it does, and should do only one thing. processData() is a lousy name. So is printTimeAndReadTemperaturesAndMakeGETRequest().
By using lots of functions, each one can be quite small. Small functions are easy to test. Once a function is KNOWN to work, with all input data, it can then be treated as an infallible black box.

Look at Robin2's serial input tutorial HERE. The recvWithStartEndMarkers() conceptually looks quite complicated, but a little study shows that it really is quite simple. A few tests will show that recvWithStartEndMarkers() just works. So, if you have a program that reads serial data, and does so by calling recvWithStartEndMarkers(), then it is quite safe to assume that any problems with the program are NOT caused by recvWithStartEndMarkers().







zz