Cell Phone App to control vex bots

Hello forum members. I am currently teaching Automation and Robotics. I am looking for an application students can download in which they can remotely control their vex robots via their cell phones. We do not have the funds to purchase the joysticks. I have seen this done but do
not know how to get it started. Ideas would be appreciate. Thanks

It is pretty tricky and would require a lot of programming and some additional hardware.

You would have to make an app that sends commands via Bluetooth to the Cortex. So on the phone side you would need to write your own app to make a virtual controller, and have some message set you would assemble in the Bluetooth communication to the Cortex.

Second part is the Cortex side. You would have to manage via serial communication to a Bluetooth processor. See this link below for something the Bots N Stuff guys did over the summer. It works but there are a bunch of things you need to do to get it hooked up.

https://vexforum.com/t/bnsbluetooth-robotc-library-for-the-hc-05/29982/1

So then we need to get back to the message handling. This is really done under the covers for you from the joystick to Vexnet to the Cortex and you should not underestimate this part. You need to parse the messages coming from the phone via Blue Tooth and put them into the proper variables to control the robot. Parsing serial communication can be painful and will require a lot of programming on your part. You also need to decide what to do when you have not parsed a message successfully within a period of time. Do you have a feedback/acknowledgement back to the phone to help manage this?

You then have multiple Bluetooth and robots to deal with. How do you know the right phone is communicating to the right robot? Bluetooth ID’s help with that, but it can be a bit manual too.

This is where other platforms have made that communication protocol/handling more integrated like FTC’s new and even more expensive platform than Vex via an Arduino phone. The new Lego robot kit announced yesterday is Bluetooth too but also is not cheap.

It can be done but I think we are a ways away from practical easy to integrate option for Vex. Still very roll your own level…

I think doing this with a vex cortex would be really difficult but definitely possible. I would recommend using an arduino. You can buy an arduino for $20-$40 and a Bluetooth module for like $6. Then there are many many tutiorials for controlling that from your phone, and is very easy to make apps for, or even get an app for

This honestly sounds like a really cool idea.

Ya it does and I hope someone picks up the concept. Over the last couple months I used BNS bluetooth quite a bit with a cortex to much success. I used specific commands in terminal and a small state machine like series of buttons. It was not full control so I didn’t have that much interest in really getting into app development (I super hate graphics) so I used this graphical app maker and was pleasantly impressed with how powerful it was.
http://ai2.appinventor.mit.edu/

For a control setup that is not updated under the hood like the VEX remote a good start would be to take a look at how ROBOTC sets up virtual worlds with the USB joystick.

#pragma debuggerWindows("joystickSimple");
#include "JoystickDriver.c"

task main()
{
  //Loop Forever
  while(1 == 1)
  {
    //Get the Latest joystick values
    getJoystickSettings(joystick);
    //Set the driving motors equal to the Y-axis values of the joysticks
    motor[leftMotor] = joystick.joy1_y1;
    motor[rightMotor] = joystick.joy1_y2;
  }
}

The driver is included and then a joystick struct is passed to the getJoystickSettings. This function updates all the different values of the joystick if there is new data available to ensure that all the changes are read in sync. Then variables inside of the struct can be called out and used like a standard vex controller.

That is actually Genius! Great Job! :smiley: