• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!
Dipendra

interfacing tm4c123 with DHT22

9 posts in this topic

The if-else construct in your loop is at least strange:

 if(!flag)
 { 
  Serial.println("Failed to read from DHT");
  else{
    Serial.print("RH% \t");

 

Share this post


Link to post
Share on other sites
15 hours ago, Dipendra said:

I want to interface DHT22 with TIVAC (tm4c123). Can anyone help me with the code.My code is not working.

DHT22_energia.ino

You haven't provided enough information to get help....  Most importantly you have not stated what about the code is not working.  Is it failing to compile?  Is it giving bad results?  Is it failing to print?  You haven't stated which library you are using, etc...  So, anyone attempting to answer your problem would just be guessing.

Try using the Adafruit library without changing anything and have it print directly to the serial monitor: https://github.com/adafruit/DHT-sensor-library  Use pin 2 (PB5) on the LaunchPad.  I just tried it on my TM4C123 and it worked.  Once that is working, try adding in the code for the LCD.

Share this post


Link to post
Share on other sites

Yes, it is failing to compile. It is showing DHT  doesn't name a type and I am facing issues with library also.I am not able to find a correct library for liquid crystal for lcd for energia.

Have you interfaced DHT22 with TM4C123?

Share this post


Link to post
Share on other sites
8 hours ago, Dipendra said:

Yes, it is failing to compile. It is showing DHT  doesn't name a type and I am facing issues with library also.I am not able to find a correct library for liquid crystal for lcd for energia.

Have you interfaced DHT22 with TM4C123?

You should post your error.

Share this post


Link to post
Share on other sites
On 3/17/2017 at 5:03 AM, Fmilburn said:

You haven't provided enough information to get help....  Most importantly you have not stated what about the code is not working.  Is it failing to compile?  Is it giving bad results?  Is it failing to print?  You haven't stated which library you are using, etc...  So, anyone attempting to answer your problem would just be guessing.

Try using the Adafruit library without changing anything and have it print directly to the serial monitor: https://github.com/adafruit/DHT-sensor-library  Use pin 2 (PB5) on the LaunchPad.  I just tried it on my TM4C123 and it worked.  Once that is working, try adding in the code for the LCD.

 

It is not compiling. It is giving an error that DHT does not name a type. I have tried library which you suggested but this library also not working for me. I want to use DHT library for TM4C123 in Energia. Did u interface DHT22 with TM4C123? Can You share your code?

Share this post


Link to post
Share on other sites

As stated above, I tried the library that I linked above with a TM4C123 / DHT22 the same day I made the post and it worked.  Use the example code that comes with the library.  I was probably using Energia V17.  Do a search with google with the error message text if you want to understand what it means. 

Share this post


Link to post
Share on other sites
On 3/17/2017 at 5:03 AM, Fmilburn said:

You haven't provided enough information to get help....  Most importantly you have not stated what about the code is not working.  Is it failing to compile?  Is it giving bad results?  Is it failing to print?  You haven't stated which library you are using, etc...  So, anyone attempting to answer your problem would just be guessing.

Try using the Adafruit library without changing anything and have it print directly to the serial monitor: https://github.com/adafruit/DHT-sensor-library  Use pin 2 (PB5) on the LaunchPad.  I just tried it on my TM4C123 and it worked.  Once that is working, try adding in the code for the LCD.

 
 

It is not compiling. It is giving an error that DHT does not name a type and it is giving me an error that PUSH is not in the scope so where should i define push?

Share this post


Link to post
Share on other sites

PUSH is not a variable in the example / library that I suggested above so you must  not be following the suggestion.  In your first post it is not defined.  It needs something like #define PUSH xxx where xxx is a pin number / designation.

Doing a search for "DHT does not name a type" on the internet will give multiple hits and solutions to the problem so you apparently did not do the search as suggested.  The library is probably installed incorrectly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now