Brainpad Tick and TinyClr

I’ve first try micropython with BrainPad Pulse, but my first video is with BrainPad Tick and TinyClr !

Special thanks to @Greg_Norris.

Here is code:

using System.Diagnostics;
using System.Threading;
using BrainPad;
// ReSharper disable FunctionNeverReturns

namespace testTinyClrOnTick
{
    static class Program
    {
        private static Button _buttonA;
        private static Button _buttonB;
        private static string _str = "Hello GHI Team !";
        static void Main()
        {
            var length = _str.Length;
            var currentIndex = 0;
            // Setup
            {
                _buttonA = new Button("A", 0.1);
                _buttonB = new Button("B", 0.1);
                Display.Clear();
                Display.Show();
            }

            // Loop
            while (true)
            {
                if (currentIndex >= length)
                    currentIndex = 0;
                // Get char
                var c=_str[currentIndex];
                Display.Text(c,0,0);
                Display.Show();

                currentIndex++;
                if (_buttonA.In() > 0)
                {
                    Debug.WriteLine("A");
                }
                if (_buttonB.In() > 0)
                {
                    Debug.WriteLine("B");
                }
                Thread.Sleep(500);
            }
        }
    }
}
5 Likes