PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Remote
libsirc
libsirc.c
1
/*
2
libsirc.c
3
4
Test harness for sonyremote control protocol library.
5
*/
6
7
/*
8
void ir_tLimit(int ms);
9
int ir_key(int irDetPin);
10
int ir_code(int irDetPin, int bits);
11
12
#define SONY_IR_ENTER 11
13
#define SONY_IR_CH_UP 16
14
#define SONY_IR_CH_DN 17
15
#define SONY_IR_VOL_UP 18
16
#define SONY_IR_VOL_DN 19
17
#define SONY_IR_MUTE 20
18
#define SONY_IR_PWR 21
19
#define SONY_IR_PRV_CH 59
20
*/
21
22
#include "
simpletools.h
"
// Library includes
23
#include "
sirc.h
"
24
25
int
main
()
// Main function
26
{
27
sirc_setTimeout
(1000);
// -1 if no remote in 1 s
28
while
(1)
// Repeat indefinitely
29
{
30
print
(
"%c button = %d, device = %d%c"
,
31
HOME
,
sirc_button
(10),
sirc_device
(10),
CLREOL
);
32
pause
(100);
33
}
34
}
35
sirc_button
int sirc_button(int pin)
Report the SONY IR remote button pressed. Removes device identifying information from the packet and ...
Definition:
sirc.c:15
sirc.h
Decode SONY IR remote signals.
HOME
#define HOME
HOME character (1) sends SimpleIDE Terminal's cursor to top-left "home" position.
Definition:
simpletools.h:233
pause
void pause(int time)
Delay cog from moving on to the next statement for a certain length of time.
Definition:
libws2812.c:125
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
main
int main(void)
Definition:
GraphicsTest.c:20
CLREOL
#define CLREOL
CLREOL character (11) erases all SimpleIDE Terminal characters to the right of the cursor.
Definition:
simpletools.h:323
sirc_device
int sirc_device(int pin)
Report the SONY device the IR remote is sending codes to. Device examples include TV (1),...
Definition:
sirc.c:26
sirc_setTimeout
void sirc_setTimeout(int ms)
Set the time limit to wait for a SONY IR remote packet.
Definition:
sirc.c:10
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17