-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding AM2320 (migration from .NET nanoFramework) #1998
Conversation
src/devices/Am2320/Am2320.cs
Outdated
/// <returns>True on success, false if reading failed.</returns> | ||
[Telemetry("Temperature")] | ||
public bool TryReadTemperature( | ||
#if NET5_0_OR_GREATER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really necessary here, since Temperature
is a value type.
am2330.TryReadTemperature(out Temperature temp); | ||
am2330.TryReadHumidity(out RelativeHumidity hum); | ||
if (am2330.IsLastReadSuccessful) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to show how to do it right: if (am2330.TryReadTemperature(out Temperature temp) && ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! You're fully right!
This PR is about adding AM2320
Origin: https://github.com/nanoframework/nanoFramework.IoT.Device/tree/develop/devices/Am2320
Microsoft Reviewers: Open in CodeFlow