3 ms·
I would like to see more of this style of code (specifically in the Arduino setting) as I'm having trouble seeing what you're up to from here. Is some place I c
by RangerScience 10y ago
I would like to see more of this style of code (specifically in the Arduino setting) as I'm having trouble seeing what you're up to from here. Is some place I can read more - ideally, actual code?
- wolfgang42 10y agoMost of the code I've written either can't be released for privacy reasons (I don't feel like scrubbing out the info of the person I wrote it for) or is weird one-off experimental code that's a pain to explain. However, I did find one standalone project that illustrates the point quite elegantly; I've just written up some documentation and posted it on https://github.com/wolfgang42/iDropper-arduino https://github.com/wolfgang42/iDropper-arduino This code cheats a little bit in that it has some delay loops in it; this is because the timings are finicky and it was a lot easier to write this way. Notice, however, that the `idrop_loop()` function that drives everything still specifies a four-millisecond maximum runtime, far under anything that I've ever needed to worry about. Let me know if you have any questions about this; I feel that some of the explanation I wrote isn't quite as clear as it should be, and because the code is so minimal (it's really more of a library than a full project) it doesn't illustrate the point quite as well as I'd like.
- dahart 10y agoI don't have any examples to share, but I'll add that the thinking behind this style is sometimes codified by style guides for projects that requires high levels of code safety. The best example I can think of is the famous "Power of Ten" rules for code safety published by NASA. Follow these rules, and the byproduct will be the kind of code we're talking about. http://pixelscommander.com/wp-content/uploads/2014/12/P10.pdf http://pixelscommander.com/wp-content/uploads/2014/12/P10.pd...