Esempio n. 1
0
 public async Task <bool> Stop()
 {
     command = STOP;
     speed   = SPEED;
     return(await bleHandler.Send(STOP));
 }
Esempio n. 2
0
        private void ProcessTextDeprecated(string text)
        {
            text = text.ToLower();

            if (UsePhrase && !text.Contains(GetPhrase.ToLower()))
            {
                return;
            }

            if (text.Contains("stop"))
            {
                bleHandler.Send(STOP);
                return;
            }

            if (text.Contains("forward") || (text.Contains("go") && !text.Contains("back")))
            {
                if (text.Contains("slow"))
                {
                    bleHandler.Send(FORWARD, new byte[2] {
                        FAST, FAST
                    });
                }
                else
                {
                    bleHandler.Send(FORWARD, new byte[2] {
                        FFAST, FFAST
                    });
                }
                return;
            }

            if (text.Contains("back") || text.Contains("reverse"))
            {
                bleHandler.Send(BACK, new byte[2] {
                    FAST, FAST
                });
                return;
            }

            if (text.Contains("right"))
            {
                bleHandler.Send(FORWARD, new byte[2] {
                    SLOW, FAST
                });
                return;
            }

            if (text.Contains("left"))
            {
                bleHandler.Send(FORWARD, new byte[2] {
                    FAST, SLOW
                });
                return;
            }

            if (text.Contains("follow"))
            {
                bleHandler.Send(FOLLOW);
                return;
            }
        }