I have a bit of a strange question here. For background, my school has a class called the human brain. In that class there is an activity where the kids use some equipment to measure brain waves. Each year, the teacher asks anyone with programming knowledge to attempt a project of controlling an rc car with those brain waves. (think “forward” and move forward).
I think I could do this pretty easily with the right equipment but I’d like to take it one step further and control our vex robot with brain waves. (granted I’m not sure how well this will work on the brain wave side of things – specifically if we will be able to be as specific as having multiple functions like “move forward”, “turn left”, “fire disc”, etc).
With all of that background out of the way, I’d like to know if there is a way that I could send commands to the brain. My ideas right now are sending the same radio signals as the controller (which I expect to be doable but difficult and requires some equipment I may not have access to), or sending terminal commands (ie pipe one program reading and interpreting brain waves into the terminal which is read by the vex brain as commands with callbacks to each function).
I would like to run this through the terminal. I already have some experience with this kind of thing in the terminal so that would be easiest for me. I can’t find any api on the PROS terminal other than output. Is it possible to send information to the brain as well as receive or is the brain write only to the terminal? If this is possible how could I go about it?
If this requires radio signals will it be possible to emulate the controller from another device? I know this is less vex-specific but if anyone has any experience/advice on this topic I’d appreciate any input you have for someone who has never touched radio signals before.
NOTE: I thought about the possibility of opening up a controller and using a micro-controller to simulate actual button presses but I cannot do that with my school’s resources. Any solution that is destructive (or potentially dangerous) to any vex electronics is not possible for me.
Hopefully this all made some sense.
The first thought that comes to mind is using an ADI port to connect to something like an an arduino. If that isn’t feasible you could use a long usb cord and connect it to a computer, but that seems less then ideal.
The ADI port is not very feasible imo. The ADI ports are only updated for user control every 10ms, so you would only be able to send 100 bits per second or about 12 bytes per second. For something as high speed as controlling the robot with brain waves, this is probably not optimal. However, if your only instructions were “Move the robot forward” or “Move the robot backward”, it could work. Another option to consider through the ADI ports is using an analog signal. By using a DAC (or analog out if your microcontroller has it), you could convert your binary values into an analog value, send it to the ADI port, and then have the brain decipher that back into binary. Please note that there is significant data loss through this method. I testing this idea with a 12-bit DAC, and received only 6 accurate bits on the V5 Brain.
Another option that has been proven to work is by communicating using the USB port. In PROS, stuff like std::cout works as expected and sends data out. Similarly, std::cin works just as well, and can be used to receive data through the
pros terminal command. I have not personally used this, but I’m sure there are others on the forums who have and can help if you choose to go this route.
The third and final option, granted you are somewhat comfortable with doing a bit of custom circuitry/external microcontrollers (which I’m assuming you are considering the project), is that you can use the smart ports as generic serial devices through the
pros::Serial class. The documentation is not online, so you will need to look at the header files to figure it out. Something important to note is that the smart ports communicate using RS-485. Things like Arduino don’t have an integrated RS-485 peripheral, so you will need to convert whatever your arduino output is into RS-485. UART output from the Arduino is most likely the easiest way to do this. If you only want one way communication (i.e only Arduino to V5 Brain, and the V5 Brain cannot talk back), you can just tie the second line to the logic not of the first line. This works as a one-way UART to RS-485 converter, but it is probably much simpler to just buy a board that handles it for you.
Lmk if you have any questions, hope this helps.