This is the code example from GHI.
I have couple questions as I couldn’t find any other documentation.
- Do I need to use pull down resistor for SignalGenerator pin?
- What are the time array elements represent? Is the first element duration for pin to be in ON state and second element is duration for the pin OFF?
public static void Main()
{
uint[] time = new uint[] { 500 * 1000, 500 * 1000 };
SignalGenerator LED = new SignalGenerator(Cpu.Pin.GPIO_Pin1, false);
// args: initial value,
// array of times,
// array start offset,
// length of array,
// repeat -- if true ==> repeat
LED.Set(false, time, 0, 2, true);//start the waveform
//... do more code here and the LED will continue to work.
//... because the default running mode is non-blocking.
}