Hi,
I would like to get the values from a digital sensor DHT connected to A0 pin. I want to perfom this in the Arducopter main loop: certainly I will implement it in fast_loop() every 2 seconds (using a counter: fast-loop is 100Hz so every 200 fast_loop() call).
The problem is that the process takes around 4ms and must be performed in a very strict timing to get the values. The process is 4 milliseconds every 2 seconds.
My question is : will I have problem ? I need to keep all flying process available (IMU, GPS, RC commands...)
Thanks for your replies
Replies
Thanks all for the replies.
I started from the arducopter programm and could do an acquisition but I am disapointed: the library provided by adafruit to use its sensor doesn't work with the ATMEGA 2560 (I suppose), I could do an acquisition about 1 time on 100, all the other acquisitions provided bad values with bad checksum. I used the fastloop and removed all the arducopter functionnalities so that the Atmega can be fully operationnal for this sensor....:-( I continue on the other part of the project, the most difficult : climb to 3000/4000 meters QNH for measuring atmospherics conditions (temp-humidity and wind). I am just finishing to build the octo-copter (quad octo).
4ms is very long so it will certainly disrupt the main loop. Even in stabilize mode about 75% of the AVR's CPU is consumed. Once in Loiter, RTL, Auto it jumps to nearly 100%. If you use a Pixhawk or PX4 you won't have any problems of course because only 11% of the CPU is used. Of course because it's only running at 0.5hz I suspect the impact on the main loop won't be visible to a human, it'll probably only be visible in the logs.
What does "DHT" stand for?
By the way, it looks like this discussion is in the ArduPlane category..I saw it anyway but..