Dipendra 0 Posted March 16, 2017 Share Posted March 16, 2017 I want to interface DHT22 with TIVAC (tm4c123). Can anyone help me with the code.My code is not working. DHT22_energia.ino Quote Link to post Share on other sites
LiviuM 43 Posted March 16, 2017 Share Posted March 16, 2017 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"); Quote Link to post Share on other sites
Fmilburn 445 Posted March 16, 2017 Share Posted March 16, 2017 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. Quote Link to post Share on other sites
Dipendra 0 Posted March 17, 2017 Author Share Posted March 17, 2017 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? Quote Link to post Share on other sites
bluehash 1,581 Posted March 17, 2017 Share Posted March 17, 2017 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. Quote Link to post Share on other sites
Dipendra 0 Posted March 21, 2017 Author Share Posted March 21, 2017 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? Quote Link to post Share on other sites
Fmilburn 445 Posted March 21, 2017 Share Posted March 21, 2017 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. Quote Link to post Share on other sites
Dipendra 0 Posted March 22, 2017 Author Share Posted March 22, 2017 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? Quote Link to post Share on other sites
Fmilburn 445 Posted March 22, 2017 Share Posted March 22, 2017 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.