Hi, I’m very new to TinyCLR (and mostly new to C# and .NET) and am busily trying it out at the moment.
I’m trying to understand how to use Thread as I haven’t had a chance to explore threading in any environment yet. I can’t find any documentation or examples that show its use however (besides threaded Blink examples) - I feel like I must be looking in the wrong place for documentation on TinyCLR so if there is an obvious resource I’m missing I’d love to be pointed towards it.
With regards to Thread in particular, I can see the general premise from the Blink example is to create a new Thread
object with the name of the function I want to run in it and call its Start()
method. If my function has parameters, how would I pass these through though?
eg.
Say I have a function declared as private static void Blink(GpioPin led_n)
, how do I modify new Thread(Blink).Start();
to pass the GpioPin
for the function to use?
Thanks!