I have tryed to connect a humidity sensor (H25K5A) to my arduino, but dont know to make the calculations
I have look at the datasheet, and are useing the calculations from it, but it only prints the number "5.00" out.
Without seeing all of your code, in code tags to avoid it being mangled by the forum software, it is not possible to give any help because it is impossible to see what type of variables you are using, how and where they are declared and initialised and how the inputs are set up. That is why you were directed to the 2 links given.
funderskov:
it's not that had to get it the code to compile just make a int off frugtighedMaal and fugtighed....
But i still need answers, for how to make the calculations work.
I can get the bl**dy code to compile very easily by declaring the variables, but how do I know how you declared them ? For all I know you declared them as bytes or chars. With that in mind I don't know whether any of the code you posted is what you are actually running.
I just want help with the calculations for the humidity sensor....
I have this code so fare:
void loop()
{
fugtighedMaal = analogRead(fugtighedSensor);
fugtighed = (50000 / (50000 + fugtighedMaal)*5);
Serial.println(fugtighed);
delay(250);
}
The answer asked to read those links. Clearly you didn't because your reply still does not use code tags. As a courtesy to the people you are asking help from, read the forum rules. Did you understand this answer?