Shop OBEX P1 Docs P2 Docs Learn Events
Parallax Propellor C Drive for Am2303 / DHT22 — Parallax Forums

Parallax Propellor C Drive for Am2303 / DHT22

Attached is a C driver/demo for the Am2303/DHT22 humidity/temperature. I did it using simple IDE; it requires only the simpletools.h library.

The Am2303 returns 2 bytes of humidity times 10, 2 bytes of degrees celsius times 10 (signed magnitude, not 2's complement, and one byte of checksum.

The function does not use another cog so the main program waits for the 3-4 msec needed to get the data.

The function is not bullet-proof; a dead or misbehaving Am2303 will hang it.

I tried to upload the .side file as well but the filetype is not allowed.

Comments

  • ElectrodudeElectrodude Posts: 1,621
    edited 2015-10-30 04:45
    You could put the .c and the .side file together in a .zip file and then upload that.

    Or you could rename the .side file to a .txt file and upload it like that.
Sign In or Register to comment.