Hello,
I am trying to use the SignalGenerator class to generate IR Codes for a remote control, I checked other posts and I think I am using it correctly, but after capturing the data with an oscilloscope, the values are off.
These is the code I have (sample code)
public class Program
{
static SignalGenerator sg;
static uint[] command = { 1000, 500, 1000, 500, 1000, 500 };
public static void Main()
{
sg = new SignalGenerator(GHI.Pins.FEZCerb.PC2, false);
var t = new ExtendedTimer((s) =>
{
Debug.Print("Sending Command...");
sg.SetBlocking(true, command, 0, command.Length, true, 0, 38000);
Debug.Print("Command Sent.");
}, null, 0, 3000);
Thread.Sleep(Timeout.Infinite);
}
}
I expected that code to generate a simple signal of 1000-off, 500-on 3 times (microseconds) using a 38kHz frequency, but the oscilloscope shows the “bumps” that are supposed to be 1000uS as 791uS, and the 500uS as 382uS.
I am sure I am not understanding how the SignalGenerator is supposed to work, Could someone explain how to use it?.. or Why I am not getting the values I expected?.
I am a programmer (lots of years) but with minimal electronics expertise, so, be gentle!
I read the Adafruit documentation about IR Receivers/Transmitters and I was able to generate the correct curves using a Photon (like Arduino)… using the same values… so I know the IR Sensor, IR Transmitter and the Oscilloscope are working!
Thanks.