Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

unexpectedly

Member Since 30 Aug 2013
Offline Last Active Sep 05 2013 08:16 PM
-----

Posts I've Made

In Topic: Is there any proper documentation for OneWire class?

30 August 2013 - 11:22 PM

It is considered good practice to use constants instead of hard-coded magic numbers, so you could define for example OneWireCommand class or enum with SkipRom = 0xCC, ReadScratchpad = 0xBE and use symbolic names, e.g. ow.WriteByte(OneWireCommand.SkipRom). I've done this in my alternative implementation.

 

Thank you. Emphasis added to the quote is by me. I was twitching about this before I got to your post. I'm new to netduino, C#, .NET, all that, but always make many many comments in your code. Two recent highlights while porting Adafruit ST7735 from AVR to PIC32:

 
[font="'courier new', courier, monospace;"][color=#008000;]//  Magical unicorn dust, 16 args[/color][/font]
[font="'courier new', courier, monospace;"][color=#008000;]//  (seriously though, not sure what these config values represent)[/color][/font]
 
... and later 
 
[color=#008000;][font="'courier new', courier, monospace;"]//  Sparkles and rainbows, 16 args[/color][/font]
[color=#008000;][font="'courier new', courier, monospace;"]//  (ditto)[/color][/font]
 
That kinda made my day.

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.