microsoft / devkit-sdk

Arduino library and package for the MXChip IoT DevKit
https://aka.ms/devkit
MIT License
69 stars 52 forks source link

useless comparisons #863

Closed Adamantinu closed 6 years ago

Adamantinu commented 6 years ago

In the GetStarted Example there are useless comparisons like if (humidity != humidity) { json_object_set_null(root_object, "humidity"); }

Those could be confusing for starters with the DevKit. Please remove them.

ArthurMa1978 commented 6 years ago

not useless, send the humidity to IoT hub only it has changed

Adamantinu commented 6 years ago

float humidity = readHumidity(); //Here you read the value of the humidity sensor ... if (humidity != humidity) //Here you compare the value of the humidity Sensor you read out, to its self {} //Therfore this Code will never be executed since the same variable can't have two values at once

Please correct me if I'm wrong, since i am normally developing in C#

ArthurMa1978 commented 6 years ago

My bad, didn't review the code carefully. Thank you! Stupid bug!!! will fix it soon.

Adamantinu commented 6 years ago

No Problem, I'm happy to help.