Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 1:4e6dc3e5ab7c
- Parent:
- 0:7c39876eb334
--- a/main.cpp Sat Aug 09 07:24:12 2014 +0000
+++ b/main.cpp Sun Aug 24 06:58:30 2014 +0000
@@ -8,7 +8,8 @@
//TX dp16 = USBTX RX dp15 = USBRX
Serial pc(USBTX, USBRX);
-int receive(RemoteIR::Format *format, uint8_t *buf, int bufsiz, int timeout = 100) {
+int receive(RemoteIR::Format *format, uint8_t *buf, int bufsiz, int timeout = 200)
+{
int cnt = 0;
while (ir_rx.getState() != ReceiverIR::Received) {
cnt++;
@@ -19,15 +20,15 @@
return ir_rx.getData(format, buf, bufsiz * 8);
}
-int main() {
+int main()
+{
pc.baud(9600);
RemoteIR::Format format;
- uint8_t buf[64];
+ uint8_t buf[512];
int bufLength = 0;
myled1 = myled2 = myled3 = 1;
while(1) {
myled1 = 0;
- memset(buf, 0x00, sizeof(buf));
bufLength = receive(&format, buf, sizeof(buf));
if(bufLength < 0) continue;
myled1 = 1;