Close

4 July - I found an app!

A project log for IP control for inexpensive line following robots

A project for my grandchildren to first build line-following robots then convert them to being controlled by their phones and tablets.

jedjed 07/04/2019 at 15:350 Comments

As I mentioned before, I'd like to find an app for android already available that I could use to control these robot cars. I think I've found one! When I searched the Play Store for UDP joystick, I found several possible solutions. I installed a couple, then this one:

Since my current mouse program still has all the debug console print statements in it, I plugged it into the Arduino IDE and, under tools, started the serial monitor. When I reset the NodeMCU it showed:

Connecting to HomeToo
.
WiFi connected
IP address: 192.168.95.111
UDP connected

Then I installed this app on a tablet and set the Destination IP to 192.168.95.111, the port to 4949, the Send Delay [ms] to 200,  and turned the OFF button to ON. I started to receive packets like these:

Received packet of size 16
1500150015001500

Received packet of size 16
1500150015001500

Received packet of size 16
1500150015001500

Received packet of size 16
1500150015001500

I can deal with these! I turned the app back off.

The app has more options. Under Settings, I checked all the boxes for "Center On Release".  Next, I turned the app on and pressed the JOYSTICK button. It showed me the screen with two simple joysticks. The values they were sending were displayed at the top. As I moved the joysticks around, those values changed and I could see in my serial monitor that the NodeMCU was seeing those same values:

Received packet of size 16
1500150015001500

Received packet of size 16
1511148115001500

Received packet of size 16
1510138915001500

Received packet of size 16
1510132015001500

Received packet of size 16
1493122915001500

Received packet of size 16
1503117315001500

 The center position sends 15001500 for each joystick. The values vary from 1000 to 2000 in each direction. There are buttons under settings to change directions. I'll make the maximum 2000 and the minimum 1000 in both directions. The top will be 2000, as will the left. That should be easiest to keep straight in my head.

Now all I need do is change ESPLineMouse.ino into ESPLineMApp.ino and process and display these packets. I'm freed of the need to write my own app!


Independence Day!

Discussions