Exemplo n.º 1
0
 public override void Entry()
 {
     ConsoleDisplayN18.Clear();
     ConsoleDisplayN18.Write("Demo Start", 0, 0);
     Thread.Sleep(1000);
     MainHandle.Context.CurrentState = new MainState(MainHandle);
 }
Exemplo n.º 2
0
 private void PrintLastDate()
 {
     ReadData();
     if (_Data != null)
     {
         ConsoleDisplayN18.Clear();
         ConsoleDisplayN18.WriteLine("The last date save in the SDCard : " + _Data.LastDate.ToString());
     }
 }
Exemplo n.º 3
0
        public override void Entry()
        {
            //To do at the start (subscribe events...)
            ConsoleDisplayN18.Clear();
            ConsoleDisplayN18.WriteLine("Hello World !");
            Thread.Sleep(1000);

            StartListen(); //start timer and interface (button Home, back and joystick)
            Timer.Tick += Timer_Tick;
        }
Exemplo n.º 4
0
        public override void Entry()
        {
            StartListen();
            ConsoleDisplayN18.Clear();
            ConsoleDisplayN18.WriteLine("Press and move the joystick.");

            _x = MainHandle.Display_N18.Width / 2;
            _y = MainHandle.Display_N18.Height / 2;
            Draw();
        }
Exemplo n.º 5
0
        public override void Entry()
        {
            StartListen();

            ConsoleDisplayN18.Clear();
            ConsoleDisplayN18.WriteLine("Size Display : " + ConsoleDisplayN18.Screen.Width + "x" + ConsoleDisplayN18.Screen.Height);
            ConsoleDisplayN18.WriteLine("Line 2");
            ConsoleDisplayN18.WriteLine("Line 3");
            ConsoleDisplayN18.WriteLine("Line 4");
            ConsoleDisplayN18.WriteLine("Line 5");
            ConsoleDisplayN18.WriteLine("0123456789X123........456789X123456___________789X12345");
            ConsoleDisplayN18.WriteLine("Line 9\nLine 10\nLine 11\nLine 12\nLine 13");
        }
Exemplo n.º 6
0
 public override void Entry()
 {
     if (_Tunes == null)
     {
         ConsoleDisplayN18.Clear();
         ConsoleDisplayN18.WriteLine("The module Tunes is not connected.You have to connect in the socket 3 and in the Gadgeteer's designer(don't forget to recompile the project).");
         Thread.Sleep(2000);
         MainHandle.Context.GoBack();
     }
     else
     {
         StartListen();
     }
 }
Exemplo n.º 7
0
 public override void Do()
 {
     _Counter++;
     ConsoleDisplayN18.Write("Counter = " + _Counter + "s", 50, 50);
     if ((_Counter % 2) == 0)
     {
         MainHandle.ButtonLeft.TurnLEDOn();
         MainHandle.ButtonRight.TurnLEDOff();
     }
     else
     {
         MainHandle.ButtonLeft.TurnLEDOff();
         MainHandle.ButtonRight.TurnLEDOn();
     }
 }
Exemplo n.º 8
0
        public override void Entry()
        {
            StartListen();

            ConsoleDisplayN18.Clear();
            ConsoleDisplayN18.WriteLine("About this DEMO Gadgeteer");
            ConsoleDisplayN18.WriteLine("Mainboard :");
            ConsoleDisplayN18.WriteLine(MainHandle.MotherCard.MainboardName);
            ConsoleDisplayN18.WriteLine(MainHandle.MotherCard.MainboardVersion);
            ConsoleDisplayN18.WriteLine("Framework :");
            ConsoleDisplayN18.WriteLine(SystemInfo.Version.ToString());
            ConsoleDisplayN18.WriteLine("Logiciel :");
            ConsoleDisplayN18.WriteLine(Assembly.GetExecutingAssembly().GetName().Name);
            ConsoleDisplayN18.WriteLine(Assembly.GetExecutingAssembly().GetName().Version.ToString());
        }
        void Timer_Tick(Gadgeteer.Timer timer)
        {
            _Counter++;
            ConsoleDisplayN18.Write("Counter = " + _Counter + "s", 50, 50);

            MainHandle.LED_Strip.SetBitmask((uint)(_Counter % 65));

            /*if ((_Counter % 2) == 0)
             * {
             *  MainHandle.ButtonLeft.TurnLEDOn();
             *  MainHandle.ButtonRight.TurnLEDOff();
             * }
             * else
             * {
             *  MainHandle.ButtonLeft.TurnLEDOff();
             *  MainHandle.ButtonRight.TurnLEDOn();
             * }*/
        }
Exemplo n.º 10
0
        public override void Exit()
        {
            //To do at the end (desubscribe events...)
            if (MainHandle.SdCard.IsCardMounted)
            {
                //save date
                _Data          = new ExampleData();
                _Data.LastDate = DateTime.Now;
                SaveData();
            }
            else
            {
                ConsoleDisplayN18.Clear();
                ConsoleDisplayN18.WriteLine("Sorry I cannot save the date.");
                Thread.Sleep(1000);
            }

            StopListen();//Stop timer and interface
        }
        public override void Entry()
        {
            if (MainHandle.LED_Strip == null)
            {
                ConsoleDisplayN18.Clear();
                ConsoleDisplayN18.WriteLine("The module Led Strip is not connected.You have to connect in the socket 3 and in the Gadgeteer's designer(don't forget to recompile the project).");
                Thread.Sleep(2000);
                MainHandle.Context.GoBack();
            }
            else
            {
                ConsoleDisplayN18.Clear();
                ConsoleDisplayN18.WriteLine("Demo led strip !");
                StartListen(); //start timer and interface (button Home, back and joystick)

                MainHandle.LED_Strip.TurnAllLedsOn();
                Thread.Sleep(1000);
                Timer.Tick += Timer_Tick;
            }
        }
Exemplo n.º 12
0
        private bool IsMountSdCard()
        {
            bool result = false;

            if (!MainHandle.SdCard.IsCardInserted)
            {
                ConsoleDisplayN18.Clear();
                ConsoleDisplayN18.WriteLine("Insert the SDCard.");
                ConsoleDisplayN18.WriteLine("After press Joystick.");
            }
            else
            {
                if (!MainHandle.SdCard.IsCardMounted)
                {
                    MainHandle.SdCard.MountSDCard();
                }

                result = true;
            }
            return(result);
        }
Exemplo n.º 13
0
 public override void Entry()
 {
     ConsoleDisplayN18.Clear();
     ConsoleDisplayN18.WriteLine(Error.Message + " " + Error.StackTrace);
 }
Exemplo n.º 14
0
 public override void Entry()
 {
     StartListen();
     ConsoleDisplayN18.Clear();
     ConsoleDisplayN18.WriteLine("Press the joystick to turn on/off the button's led.");
 }
Exemplo n.º 15
0
        public void Draw()
        {
            string txt = _IsDetails ? "X (" + _x + "," + _y + ")" : "X";

            ConsoleDisplayN18.WriteSimple(txt, _x, _y);
        }
Exemplo n.º 16
0
        public void Clear()
        {
            string txt = _IsDetails ? "X (" + _x + "," + _y + ")" : "X";

            ConsoleDisplayN18.ClearSimple(txt, _x, _y);
        }