From 6ecc1e5f84968c716fac615792ec61b375149035 Mon Sep 17 00:00:00 2001 From: schneider Date: Thu, 22 Dec 2011 15:05:50 +0100 Subject: [PATCH] added l0dable to see who is nearby --- firmware/l0dable/people.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 firmware/l0dable/people.c diff --git a/firmware/l0dable/people.c b/firmware/l0dable/people.c new file mode 100644 index 0000000..4f85e17 --- /dev/null +++ b/firmware/l0dable/people.c @@ -0,0 +1,38 @@ +#include +#include + +#include "basic/basic.h" +#include "basic/config.h" + +#include "lcd/render.h" +#include "lcd/print.h" + +#include "funk/nrf24l01p.h" +#include "usetable.h" + +/**************************************************************************/ + +void ram(void) { + struct NRF_CFG config; + uint8_t buf[16]; + + config.nrmacs=1; + config.maclen[0] = 16; + config.channel = 81; + memcpy(config.mac0, "\x01\x02\x03\x02\x01", 5); + nrf_config_set(&config); + lcdClear(); + lcdPrintln("People nearby:"); + //lcdPrint("nearby:"); + lcdRefresh(); + do{ + if( nrf_rcv_pkt_time(64,sizeof(buf),buf) == 16 ){ + buf[14] = 0; + if( buf[1] == 0x23 || buf[1] == 0x24){ + lcdPrintln(buf+6); + //lcdPrintln("foo"); + } + lcdRefresh(); + } + }while ((getInputRaw())==BTN_NONE); +}