Remote control Ev3 by EDIMAX EW-7811-Un

HomeForumsMonoBrick EV3 FirmwareRemote control Ev3 by EDIMAX EW-7811-Un

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4120
    Author Image
    minghan Li
    Participant

    sorry~

    I want to remote control ev3 but i only EDIMAX EW-7811-Un.
    So I have to use MonoBrick Firmware.
    however that C# code is like this?

    using System;
    using MonoBrick.EV3;
    namespace Application
    {
    public static class Program{
    static void Main(string[] args)
    {

    try{
    var ev3 = new Brick<Sensor,Sensor,Sensor,Sensor>(“WiFi”);
    sbyte speed = 0;
    ev3.Connection.Open();
    ConsoleKeyInfo cki;
    Console.WriteLine(“Press Q to quit”);
    do
    {
    cki = Console.ReadKey(true); //press a key
    switch(cki.Key){
    case ConsoleKey.R:
    Console.WriteLine(“Motor A reverse direction”);
    ev3.MotorA.Reverse = !ev3.MotorA.Reverse;
    break;
    case ConsoleKey.UpArrow:
    if(speed < 100)
    speed = (sbyte)(speed + 10);
    Console.WriteLine(“Motor A speed set to ” + speed);
    ev3.MotorA.On(speed);
    break;
    case ConsoleKey.DownArrow:
    if(speed > -100)
    speed = (sbyte)(speed – 10);
    Console.WriteLine(“Motor A speed set to ” + speed);
    ev3.MotorA.On(speed);
    break;
    case ConsoleKey.S:
    Console.WriteLine(“Motor A off”);
    speed = 0;
    ev3.MotorA.Off();
    break;
    case ConsoleKey.B:
    Console.WriteLine(“Motor A break”);
    speed = 0;
    ev3.MotorA.Brake();
    break;
    }
    } while (cki.Key != ConsoleKey.Q);
    }
    catch(Exception e){
    Console.WriteLine(“Error: ” + e.Message);
    Console.WriteLine(“Press any key to end…”);
    Console.ReadKey();
    }
    }
    }
    }

    EDIMAX EW-7811-Un can also use the same code??

    thanks~

    #4122
    Author Image
    Anders Søborg
    Keymaster

    Hi thanks for trying the Monobrick firmware. To remote control the EV3 over a WiFi connection you do not need to use the MonoBrick communication library – in fact if you read closely here you will see that the communication library only works with the standard firmware. To establish a connection from a PC to the EV3 running the MonoBrick firmware you simply need to have a program running on the EV3 that accepts a TCP/IP connection and then have the PC establish a connection. Use google to find one of the many tutorial on how to do this in C#…

    Anders

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Posted in

Make a donation