Remote control from smartphone

 
3r3-31. In two previous articles, I talked about using a smartphone to control a toy car, either directly with the voice or using another smartphone via Bluetooth. But management was primitive - the team was given, the car carried out the command, stopped and waited for the next command. This was due to the high speed of the car for room conditions (approximately 1.2 m /s), as well as the long time the command was given and the inability to quickly intervene in the movement using the menu. Even the regular remote control did not give control. In the new version of the remote control with a graphical interface, I decided to use PWM to adjust the speed and simulate steering.
 
 
Remote control from smartphone  
 
The picture shows the machine, which controls the smartphone, and below the smartphone with a running remote control program for bluetooth.
 
3r314.
 
At the top of the screen is a slider (green circle) moved by a finger.
 
 

 
 
When you remove your finger from the screen, the relative distance from the slider to the left edge of the screen is transferred to the control smartphone, where the latitudinal modulation of the pulse signal is formed.
 
 
GR.GET.POSITION c? xx, yy
r6 = (xx-xc) * (xx-xc) + (yy-yc) * (yy-yc)
IF r6
 
The smallest signal ratio of 20%, the largest 80%. The theoretical possible frequency is 10 Hz. In fact, probably around 4 - 5 Hz, since the signals for modulation go in the general flow of commands, and some of them also have a time delay. Therefore, at a low duty cycle, vibration is clearly visible.
 
 
Two green buttons - upper forward movement, lower back. On the right red button - to stand still. Two white buttons - stop programs on the remote control and on a typewriter. At the bottom of the screen are three purple buttons to choose the direction of movement to the left, right and right. With 3r3121.  
on, the corresponding mode, in the center of the button appears a circle of smaller diameter and the same, but darker color. To control the direction of motion in addition to the buttons, I also used the accelerometer. In the horizontal position of the smartphone, the projection of the gravitational acceleration vector on the axis 0Y equals ? which corresponds to the movement straight (see figure above).
 
 
3r361.
 
 
If you lift the left side of the smartphone, the projection will be with a + sign, which will correspond to the movement to the right.
 
 
 
 
If you raise the right side with the sign - that will correspond to the movement to the left.
 
The program reads the accelerometer and sends the corresponding commands to the smartphone driving the car, displaying the mode on the buttons.
 
 
    SENSORS.READ ? sx, sy, sz
IF (sy <=1)&(sy> -1) & (lrsh) THEN
rsh = 1
lsh = 1
lrsh = 0
GR.HIDE cc13
GR.HIDE cc15
GR.SHOW cc17
GR.RENDER
BT.write "f"
pause 100
ENDIF
IF (sy> 2) & (rsh) THEN
rsh = 0
lsh = 1
lrsh = 1
GR.HIDE cc13
GR.HIDE cc17
GR.SHOW cc15
GR.RENDER
BT.write "r"
pause 100
ENDIF
IF (sy <-2)&(lsh) THEN
Lsh = 0
Rsh = 1
pause 100
ENDIF
3r3-3202  
This is how the remote control works. The work of the car control program has also changed, but not very significant. In the future, I want to supplement the program with the functions of memorizing commands and executing them automatically.
+ 0 -

Comments 18

Offline
morning world
morning world 11 November 2018 09:35
Thanks for this great  post, i find it very interesting and very well thought out and put together.  I look forward to reading your work in the future.  Salem  OR
Offline
morning world
morning world 12 November 2018 09:47
I was  surfing the Internet for information and came across your blog. I am  impressed by the information you have on this blog. It shows how well you  understand this subject. טיול  מאורגן
Offline
Anna Sally
Anna Sally 22 November 2018 14:12
 I've appreciated their willingness to take on our project when no one else would especially for the Communications  Directory. They developed a low-maintenance platform that supports more a lot of my clients.
Offline
Anna Sally
Anna Sally 16 December 2018 10:35
I absolutely hate coupon codes that don't work! The great thing about GetACode.com is that they guarantee their codes will work (or they'll give you a gift card from Amazon) savings
Offline
Anna Sally
Anna Sally 17 December 2018 20:41
I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. suddenlink  speed test
Offline
Anna Sally
Anna Sally 18 December 2018 20:20
I’ve been surfing online more than three hours today, yet I never found any interesting article like yours. It’s pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. Sell  Used Test Equipment
Offline
life time
life time 24 December 2018 12:30
I'm glad to see the  great detail here!. onlinemusicpromotion.net


I learn some new stuff from it too, thanks for sharing your information. 토토
Offline
Anna Sally
Anna Sally 24 December 2018 20:37
I really impressed  after read this because of some quality work and informative thoughts . I  just wanna say thanks for the writer and wish you all the best for coming!.
Zahnarzt  Düsseldorf
Offline
Anna Sally
Anna Sally 26 December 2018 17:40
You have done a great job on this article.  It’s very readable and highly intelligent.  You have even managed to make it understandable and easy to read.  You have some real writing talent. Thank you.cat  grooming nyc
Offline
fuzailfaisal
fuzailfaisal 1 January 2019 13:23
Superbly written  article, if only all bloggers offered the same content as you, the internet  would be a far better place.. wallets  crossbody bags
Offline
iphone repair
iphone repair 3 January 2019 11:24
I would like most of the accounts, Favor actually enjoyed, We wish addiitional details regarding it, because it will be comparatively outstanding., Respect only for proclaiming. iphone repair

Offline
Aaron Jordan
Aaron Jordan 5 January 2019 17:06
This type of looks  entirely finest. These tiny details are usually made along with a lot of  foundation details. I prefer in which a lot. http://www.juvewin.info/
Offline
sohail khatri
sohail khatri 7 January 2019 20:40
pretty fine make regarded. I simply stumbled upon your weblog and wanted to call that i have absolutely enjoyed browsing your blog posts. After altogether one ill be subscribing to your feed and that i goal you write anew quickly!iptv uk
Offline
sohail khatri
sohail khatri 8 January 2019 20:35
totally exciting save postingColossalCheats FPS hacks
Offline
ASD
ASD 10 January 2019 15:54
maximum of the technology I dont make remarks almost websites, but i would at the back of to publicize that this newsletter in fact mad me to reach suitably. really pleasant display!read more


Offline
fuzail
fuzail 12 January 2019 15:32
We have  sell some products of different custom boxes.it is very useful and very low  price please visits this site thanks and please share this post with your  friends. חבילת  נופש
Offline
sohail khatri
sohail khatri 12 January 2019 17:31
this newsletter turned into written by means of a precise thinking writer.  I put up the various thinking about the stable points made through the author.  unwell be proclamation.<unblocked school games
Offline
sohail khatri
sohail khatri 13 January 2019 19:40
i am satisfied you do something pride in what you write.  This makes you stand upload information to out from many new writers that shove knocked out the weather written content.CoC Hack

Add comment