aboutsummaryrefslogtreecommitdiff
path: root/examples/dht22usart/dht22.c
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-10-17 15:40:51 +0200
committerKarel Kočí <cynerd@email.cz>2015-10-17 15:40:51 +0200
commitb0d8f22f3492fbb3f6dc0e8026e63c803af59007 (patch)
treeeb9707612e87856962474885f2a18ae1621d214e /examples/dht22usart/dht22.c
parent8fa9db4244f4ee33aa47561c569edfa62fe37928 (diff)
downloadavr-ioe-b0d8f22f3492fbb3f6dc0e8026e63c803af59007.tar.gz
avr-ioe-b0d8f22f3492fbb3f6dc0e8026e63c803af59007.tar.bz2
avr-ioe-b0d8f22f3492fbb3f6dc0e8026e63c803af59007.zip
Complete commit of current work
Diffstat (limited to 'examples/dht22usart/dht22.c')
-rw-r--r--examples/dht22usart/dht22.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/dht22usart/dht22.c b/examples/dht22usart/dht22.c
new file mode 100644
index 0000000..97a91ee
--- /dev/null
+++ b/examples/dht22usart/dht22.c
@@ -0,0 +1,26 @@
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <string.h>
+#include "../../usart.h"
+#include "../../sensor_dht22.h"
+
+void rec(uint8_t data) {
+ if (data == '\r') {
+ // TODO read sensor and send data
+ }
+}
+
+const struct dht22_port dht22_ports[] = {
+ {&DDRC, &PORTC, &PINC, _BV(PORTC4), NULL, 0}
+};
+
+int main() {
+ //usart_async_open();
+ //sei();
+ //usart_receive = rec;
+ //dht22_init(0);
+
+ timer_init(COUNTER0_PWM);
+ while (1);
+}