Not Really My Life Story

KiloBravo

Member
Licensed User
I have been on the Forum about two years. I read about B4R from Nuts & Volts Magazine. Fred Eddy wrote a few articles about B4A and B4R. I was impressed with B4R after reading a couple of his articles. It seemed easy enough to learn and I was amazed at what a few lines of code could do. I was also interested in the ESP8266. I use to program Microchip PIC controllers in assembler then later C. I still do on occasion. But the power and simplicity of B4X is truly amazing when compared to MPLAB X and the ESP-IDF Build Environment. The folks on this forum have been great as well. Either answering my questions or pointing me in the right direction.
Lately I have been working on an autonomous lawn mower project based on a used power scooter chair. Anyway I decided to build a smaller one to work on the autonomous part in my living room. I got it together and the base would glitch and turn left when I was not sending a udp control packet. I checked my hardware and determined that was not the fault. Then thought maybe it is the B4R code, possibly a bug in the wifi. But hey we all know Erel is better than that ! It turned out to be a glitch in the WII Mote stick I was using for manual control. The Y-axis always sends 137 when the stick is neutral. The X-axis usually always sends 136 but occasionally will glitch and send 137. So I added one line of code after reading the stick with I2c.
If data(0) = 136 Then data(0) = 137 ' Glitches btwn 136 & 137 Y is always 137 so make them = for Neutral
All good now.
P.S. I really like Turtle as well. It got me thinking about some kind of translational reality program like Pac Man. So my daughter can play a game on her tablet, while she is actually mowing our lawn !
Best of Luck to Erel and B4X, as well as all the Forum Members, may we all live Healthy and Happy Lives.
Whenever somebody asks me if I wish I had more $$$. I always so no I will take good health any day, ask Steve Jobs. I am not trying to be funny he had all the money anyone could ever want but all his money could not bring him good health, unfortunately. Take Care !
 

LucaMs

Expert
Licensed User
Thanks for the tip Luca. Never mind about the joke. Greek joke. Skip to the sorry clause (which was written immediately in the next message). What does cotica mean?
Don't worry, I often (too often) joke.

"cotica", which I don't like at all, is pig skin (to eat 🤮)
 

hatzisn

Well-Known Member
Licensed User
So it has nothing to do with lawn. My dictionary application fooled me as I got five translations for cotica (one of them was indeed pig skin but the others were related to lawn - isn't it related even metaphorically at all, or should I consider dumping this application? :) )
 

KiloBravo

Member
Licensed User
The only thing that offended me was the picture of the lawn that was posted. I wish my lawn looked that good ! LOL
The little bot was to work on autonomous navigation without any human intervention. It is probably better to work out the details with that before I let the big one roam around with a metal cutting blade spinning at 1800 rpm !
But you have me thinking maybe I will hook up a vacuum cleaner to the little bot ! ;-)
 

KiloBravo

Member
Licensed User
So, ~7 weeks ago, I had no idea where to start for the B4X UI side. My current project is to have my lawn cut by my "AutoMower".
I spent the last 7 weeks learning B4X and how to create a UI.

Erel and many forum members got me on the right path. I took Erel's post from the thread below and started from there.

Now I have the B4X UI (Command Module) and B4R (ESP8266) Apps actively interacting over a TCP connection with the ESP8266 as an AP (Control Module). I also was able to get it working over UDP this week as well.
Code is not "pretty" but it works. (I need to go back and clean up the code odor)

Image is not great. I took it off Google Maps and cropped it for testing purposes.
It is not straight or square do to the satellite angle. Also, a Fall pic so the trees/leaves don't block the yard view.
(LucaMs, now you know why I was offended by your picture of the lawn!) LOL !!!
In the screen shot the Green Path is traveling Up on the Grid. Purple is traveling Down on the Grid. Red Blocks are to be avoided.

Currently tweaking the Control side. When the ESP8266 receives the grid "path" and Command Packet from B4J(PC), It sends it via I2C to a PIC16F18346. The PIC will convert the grid x,y coordinates to wheel rotations so the AutoMower knows where to go, what to do, and hopefully what to avoid! Also, tweaking a PID algorithm in C for the PIC to keep it going straight by having the wheels turn the same number of rotations. This works by wheel encoder feedback and adjusting the PWM.

I was actually going to Title this "How Erel Ruined My Life!" LOL I am actually dreading going back in the PIC side and using the MPLAB-X IDE. I really prefer the B4X IDE these days !!! Maybe not the right place to post, but this is what I "try" to do with B4X.
:cool:

prj001.jpg
 
Top