bschwind / ir-slinger

A small C library for sending infrared packets on the Raspberry Pi
The Unlicense
99 stars 30 forks source link

Bug in python Implementation of IR slinger #7

Closed adithyaselv closed 7 years ago

adithyaselv commented 7 years ago

I guess its probably a typo or something line 111 of pyslinger.py NEC protocol Zero and ones

def zero(self):
        self.wave_generator.one(self.one_pulse_duration)
        self.wave_generator.zero(self.zero_pulse_duration)

    # One is represented by a pulse and a gap three times longer than the pulse
def one(self):
        self.wave_generator.one(self.zero_pulse_duration)
        self.wave_generator.zero(self.zero_gap_duration)

it should be

def zero(self):
        self.wave_generator.one(self.zero_pulse_duration)
        self.wave_generator.zero(self.zero_gap_duration)

    # One is represented by a pulse and a gap three times longer than the pulse
def one(self):
        self.wave_generator.one(self.one_pulse_duration)
        self.wave_generator.zero(self.one_gap_duration)

to get it work correct Thanks

bschwind commented 7 years ago

Hey, thanks for the heads up. Would you mind creating a pull request with your proposed changes?

adithyaselv commented 7 years ago

Aha since it was a small thing I thought you could do it yourself ! Cool work Btw 😃

bschwind commented 7 years ago

Ah you formatted your post, I can see the change more clearly now. Yeah it's a one line change, I can go ahead and fix it.

EDIT - Well, not "one-line", but I see what needs to be changed now.

adithyaselv commented 7 years ago

Aha yea ! 👍