Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

GUI-O Speed Controller

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
matjazs

Bascom Member



Joined: 08 Nov 2016
Posts: 23

PostPosted: Thu Apr 08, 2021 9:02 pm    Post subject: GUI-O Speed Controller Reply with quote

Hello.
I found a very interesting universal Android app that can replace touch screens for electronics, using smart phone.
The electronic circuit can also works as an IoT through this application. (ESP8266 module is used instead of Bluetooth module)
The application is managed via Bluetooth, USB or WiFi connection. On the electronics side, the standard serial TTL RS232 is used.

https://play.google.com/store/apps/details?id=com.guio.guioapp
or
www.gui-o.com

You can also find Bascom examples and detailed instructions on this website.

Simply install the app on your smartphone or other Android device. Connect your device (TTL RS232) to your project via Bluetooth or USB. Use the menu to set the type of communication and then send the TXT initialization process.

One or more different devices can be managed with this application. (microcontrollers, Arduino, embeded PC, PC, PLC controllers, ... all devices using standard serial RS232, Bluetooth, USB or WiFi)

Here is a simple Bascom example of “Speed ​​Measurement” with the HB100 radar sensor. I took the concept and calculation from the Arduino forum.
I used and defined GUI-O objects and such an application was created. I used Bluetooth HC05/HC06 for communication, but it also works with other Bluetooth modules, even BLE. The accuracy of the measurement speed depends on the quality of the sensor and the gain of the operational amplifier. The scheme, images and source code are attached.
NOTE. Rx and Tx Bluetooth modul is conected to PD.0 (D0) and PD.1 (D1) and NOT to PD.3 (D3) and PD.4(D4).

Init procedure:

Code:
Init_guio:
 Disable Int0
 Disable Timer1

 Print "@sls"                                               ' hide writing objects
 Print "@cls"                                               ' clear HW components of smart phone
 Print "@clh"                                               ' clear screen on smart phone
 Print "@guis BGC:#000000 ASR:0.449671"                     ' set background- black and resolution of phone

'Picture "speed_p.jpg >> copy this picture on smart phone to directory " Galaxy A51\Phone\Android\data\com.guio.guioapp\files\Pictures"
 Print "|IM UID:im1 X:50 Y:20 W:100 H:100 ROT:0 SHE:0 IP:" ; Chr(34) ; "speed_p.jpg" ; Chr(34)

 'Label
 Print "|LB UID:lb1m X:5 Y:32 ALP:1 SHE:1 ROT:0 FGC:#FFFFFF FSZ:4.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "Speed Control" ; Chr(34)

 Print "|LB UID:lbimp X:82 Y:32 ALP:1 SHE:1 ROT:0 FGC:#990000 FSZ:3.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "115 km/h" ; Chr(34)
 'Line
 Print "|BSL UID:bsl1 X:0 Y:35 FGC:#A6AEA9 LEN:100 BTH:0.5"

 'Rechtangle object
 Print "|BSR UID:bsr1 X:50 Y:58 W:100 H:25 RAD:1 BGC:#454546 FGC:#454546"
 'Slider
 Print "|SL UID:sl2 X:49 Y:41 W:50 H:6 RAD:0.2 OPA:1 HAH:0 HAW:0 CE:1 VAL:0 BGC:#737373 SFGC:#990000 FGC:#78AB46 LVAL:0 HVAL:60"

 Print "|LB UID:lbsec1 X:5 Y:41 ALP:1 SHE:1 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "Speed" ; Chr(34)
 'Circular Bar
 Print "|CB UID:cb_speed_indicator X:50 Y:58 W:45 CE:0 SHE:1 HAW:0 BGC:#737373 FGC:#78AB46 SFGC:#990000 BTH:3 LVAL:0 HVAL:90 VAL:0 STA:270 ENA:-90"

 Print "|LB UID:lb_speedm X:50 Y:58 FSZ:5 SHE:1 FGC:#cd1e2c FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "0 km/h" ; Chr(34)

 Print "|BSL UID:bsl2 X:0 Y:84 FGC:#A6AEA9 LEN:100 BTH:0.5"

 'Graph
 Print "|CH UID:pl1 X:50 Y:85 W:99 H:25 VIS:1 BTH:0 XMA:6 YMA:3 XTC:4 YTC:5 YHI:100 BGC:#454546 FGC:#FFFFFF RAD:1 CHN:" ; Chr(34) ; "Speed (km/h)" ; Chr(34) ; " FFA:" ; Chr(34) ; "font0" ; Chr(34) ; " FSZ:1.2"

 Print "|LB UID:lb_nrcat X:83 Y:39 FSZ:3 SHE:1 FGC:#FFFFFF FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "Car Nr." ; Chr(34)
 Print "|LB UID:lb_nrcar X:83 Y:43 FSZ:4 SHE:1 FGC:#FFFFFF FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; Countc ; Chr(34)

 Print "|LB UID:lb_vavgt X:15 Y:55 FSZ:4 SHE:1 FGC:#FFFFFF FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "AVG" ; Chr(34)
 Print "|LB UID:lb_vmaxt X:85 Y:55 FSZ:4 SHE:1 FGC:#FFFFFF FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "MAX" ; Chr(34)
 Print "|LB UID:lb_vavg X:15 Y:60 FSZ:4 SHE:1 FGC:#FFFFFF FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; Vavg ; Chr(34)
 Print "|LB UID:lb_vmax X:85 Y:60 FSZ:4 SHE:1 FGC:#FFFFFF FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; Vmax ; Chr(34)

 Print "|BT UID:bt_frozen X:85 Y:66 W:16 H:4 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#A0A0A4 SBGC:#6e5b5b FSZ:3 FGC:#FFFFFF SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "Hold" ; Chr(34) ; " SVAL : " ; Chr(34) ; "bt1 " ; Chr(34)

 'HW components on Phone - Sound
 Print "|TON UID:ton1 HID:ton EDUR:1000 TONT:24"
 'HW components on Phone - Vibration
 Print "|VIB UID:vib1 HID:vib EDUR:1000"

 Print "@hls 250"                                           'After loading objects show complete picture

 Enable Int0
 Enable Timer1
Return



Copy the image "sped_p.jpg" to your smartphone in the directory:
"\ Phone \ Android \ data \ com.guio.guioapp \ files \ Pictures \"

For a quick test, you can even use an Arduino UNO and connect a key to PIND.2 instead of HB100.

There is also a Youtube video.
https://www.youtube.com/watch?v=sU3rJ2CZVCA
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2126

netherlands.gif
PostPosted: Thu Apr 08, 2021 9:16 pm    Post subject: Reply with quote

Cool, very interesting.
Thanks for sharing.

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5199
Location: Holland

blank.gif
PostPosted: Wed Apr 14, 2021 8:19 pm    Post subject: Reply with quote

Thank you for sharing and of course about the information about this.

I need to check out this HB100 radar sensor. Seems cool Smile

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum