-
Notifications
You must be signed in to change notification settings - Fork 30
/
test.c
33 lines (30 loc) · 1.41 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include "irslinger.h"
int main(int argc, char *argv[])
{
uint32_t outPin = 23; // The Broadcom pin number the signal will be sent on
int frequency = 38000; // The frequency of the IR signal in Hz
double dutyCycle = 0.5; // The duty cycle of the IR signal. 0.5 means for every cycle,
// the LED will turn on for half the cycle time, and off the other half
int leadingPulseDuration = 9000; // The duration of the beginning pulse in microseconds
int leadingGapDuration = 4500; // The duration of the gap in microseconds after the leading pulse
int onePulse = 562; // The duration of a pulse in microseconds when sending a logical 1
int zeroPulse = 562; // The duration of a pulse in microseconds when sending a logical 0
int oneGap = 1688; // The duration of the gap in microseconds when sending a logical 1
int zeroGap = 562; // The duration of the gap in microseconds when sending a logical 0
int sendTrailingPulse = 1; // 1 = Send a trailing pulse with duration equal to "onePulse"
// 0 = Don't send a trailing pulse
int result = irSling(
outPin,
frequency,
dutyCycle,
leadingPulseDuration,
leadingGapDuration,
onePulse,
zeroPulse,
oneGap,
zeroGap,
sendTrailingPulse,
"01000001101101100101100010100111");
return result;
}