GUI-O Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. gammda
    G
    • Profile
    • Following 0
    • Followers 0
    • Topics 19
    • Posts 33
    • Best 1
    • Controversial 1
    • Groups 0

    gammda

    @gammda

    1
    Reputation
    13
    Profile views
    33
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    gammda Unfollow Follow

    Best posts made by gammda

    • GUI-O Serial Protocol Generator

      This device generates serial data. Port settings are available via this GUI-O interface.

      Possible settings are text, baudrate, data offset and random number.
      AVR microcontroller is used.

      0c952088-cb3c-4858-ae2b-c3a867a2d6c1-Screen1.jpg

      posted in Share Your Projects
      G
      gammda
    • RE: "PGF:1" parameter

      @Bernard
      In your Sub, the Return statement is used twice. Maybe that's the problem.
      After first return statement must be:
      Guio_ini_2:

      @hls 250 should be at the end of the Init procedure.
      I checked the Init process without the Bascom code and it works OK.

      Maybe put |CH

      |CH UID:ch0 X:50 Y:75 W:50 H:50 XLO:0 BSZ:120 VLP:2 BGC:#E53A4456 FGC:#EF33EAF5 SHE:1 FSZ:2.5 RAD:1 CHT:2 CHN:'MESURE HUM / TEMP / PRESSION' XTC:12 YTC:6 YMA:4 XMA:2 XHI:75 PZO:0
      
      
      @hls 250
      

      just before @hls 250

      Otherwise, your GUI-O screen is very nice 👍

      posted in General Discussion
      G
      gammda

    Latest posts made by gammda

    • RE: CHB parameter ACT:

      You must choose:

      @chb2 EN:0 or
      @chb2 EN:1

      posted in Report Bugs
      G
      gammda
    • GUI-O Serial Protocol Generator

      This device generates serial data. Port settings are available via this GUI-O interface.

      Possible settings are text, baudrate, data offset and random number.
      AVR microcontroller is used.

      0c952088-cb3c-4858-ae2b-c3a867a2d6c1-Screen1.jpg

      posted in Share Your Projects
      G
      gammda
    • RE: LB widgets disappeared in GUI-O

      This is example Init :
      https://forum.gui-o.com/topic/223/gui-o-energy-meter

      @sls 500 
      @cls
      @clh
      @clo
      @gse COD:0 TSC:39
      @guis BGC:#000000 ASR:0.449671
      
      |IM UID:im0 X:50 Y:50 W:100 H:100 ROT:0 SHE:0 VIS:1 ACT:0 OPA:1 SCM:1 PLS:1 IP:'https://i.imgur.com/zZuSWyR.png' 
      |IM UID:imlcd X:50 Y:20 W:90 H:90 ROT:0 SHE:1 SHHR:2 SHVR:2 VIS:1 ACT:0 OPA:1 IP:'https://i.imgur.com/WGJpsI4.png' 
      
      |LB UID:lben X:50 Y:20.5 ALP:0 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#000000 FSZ:4 FFA:'font8' TXT:'25,101 KWh'
      |LB UID:lbv X:5 Y:35 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'231.048 V' 
      |LB UID:lba X:5 Y:40 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'0.057 A' 
      |LB UID:lbw X:5 Y:45 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'7.229 W' 
      |LB UID:lbf X:5 Y:50 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'50.000 Hz' 
      |LB UID:lbp X:5 Y:55 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'PF:1.000' 
      |LB UID:lbw1 X:5 Y:60 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'Wmax 47.046 W' 
      
      |LB UID:lb0 X:50 Y:6 ALP:0 SHE:1 ROT:0 FGC:#FFFFFF FSZ:5 FFA:'font7' TXT:'Energy Meter' 
      |BSR UID:bsrsh X:52 Y:78 W:95 H:27 RAD:0 OPA:0.5 BGC:#000000 SBGC:#000000 FGC:#000000 BTH:0
      |CH UID:pl1 X:50 Y:77 W:95 H:27 SHE:1 VIS:1 OPA:1 PZO:1 BGC:#000000 FGC:#FFFFFF CHT:0 FSZ:1.2 SHVL:1 VLP:0 CHN:'ENERGY METER' RAD:0.5 BTH:0 LT:0.3 XTC:6 YTC:5 XMA:6 YMA:4 YLO:0 YHI:10 SHG:0 DRAT:0.90 DRA:50 
      |IM UID:imexit X:85 Y:95 W:14 H:14 ROT:0 SHE:1 SHHR:1 SHVR:1 VIS:1 OPA:1 SCM:2 PLS:1 IP:'https://i.imgur.com/8hDtY92.png'
      |LB UID:lbms X:5 Y:95 ALP:1 SHE:1 ROT:0 FGC:#FFFFFF FSZ:2.5 FFA:'font7' TXT:'(c) gammda 2024' 
      
      
      @hls 200
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,1.7,1.1,6' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.8,2.2,8' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.4,1.8,7' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'2,3.2,1.6,4' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,2.3,2.2,4.5' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5,2.2,1.6,4.8' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5.4,1.7,1.1,3.4' XP:'0,0,0,0'
      
      posted in Report Bugs
      G
      gammda
    • LB widgets disappeared in GUI-O

      I noticed that LB widgets are missing from my GUI-O app this morning. I thought something was wrong with my smartphone. I checked this on my Samsung tablet where the previous version of GUI-O is installed. And it worked fine there. After updating to version 1.0.90, the same problem occurs. Is it possible that there is something wrong with the new version of GUI-O?

      posted in Report Bugs
      G
      gammda
    • RE: DDS Signal generator

      @efe24
      Please write in english.

      posted in Share Your Projects
      G
      gammda
    • GUI-O Energy Meter

      Here is a Energy Meter that uses the MODBus protocol and GUI-O. 😉

      fd71a40c-b123-4457-959e-3583688dcc63-image.png
      InitF.jpg

      >>Init file
      @sls 500 
      @cls
      @clh
      @clo
      @gse COD:0 TSC:39
      @guis BGC:#000000 ASR:0.449671
      
      |IM UID:im0 X:50 Y:50 W:100 H:100 ROT:0 SHE:0 VIS:1 ACT:0 OPA:1 SCM:1 PLS:1 IP:'https://i.imgur.com/zZuSWyR.png' 
      |IM UID:imlcd X:50 Y:20 W:90 H:90 ROT:0 SHE:1 SHHR:2 SHVR:2 VIS:1 ACT:0 OPA:1 IP:'https://i.imgur.com/WGJpsI4.png' 
      
      |LB UID:lben X:50 Y:20.5 ALP:0 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#000000 FSZ:4 FFA:'font8' TXT:'25,101 KWh'
      |LB UID:lbv X:5 Y:35 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'231.048 V' 
      |LB UID:lba X:5 Y:40 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'0.057 A' 
      |LB UID:lbw X:5 Y:45 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'7.229 W' 
      |LB UID:lbf X:5 Y:50 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'50.000 Hz' 
      |LB UID:lbp X:5 Y:55 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'PF:1.000' 
      |LB UID:lbw1 X:5 Y:60 ALP:1 SHE:1 SHHR:0.8 SHVR:0.8 ROT:0 FGC:#FFFFFF FSZ:3.5 FFA:'font10' TXT:'Wmax 47.046 W' 
      
      |LB UID:lb0 X:50 Y:6 ALP:0 SHE:1 ROT:0 FGC:#FFFFFF FSZ:5 FFA:'font7' TXT:'Energy Meter' 
      |BSR UID:bsrsh X:52 Y:78 W:95 H:27 RAD:0 OPA:0.5 BGC:#000000 SBGC:#000000 FGC:#000000 BTH:0
      |CH UID:pl1 X:50 Y:77 W:95 H:27 SHE:1 VIS:1 OPA:1 PZO:1 BGC:#000000 FGC:#FFFFFF CHT:0 FSZ:1.2 SHVL:1 VLP:0 CHN:'ENERGY METER' RAD:0.5 BTH:0 LT:0.3 XTC:6 YTC:5 XMA:6 YMA:4 YLO:0 YHI:10 SHG:0 DRAT:0.90 DRA:50 
      |IM UID:imexit X:85 Y:95 W:14 H:14 ROT:0 SHE:1 SHHR:1 SHVR:1 VIS:1 OPA:1 SCM:2 PLS:1 IP:'https://i.imgur.com/8hDtY92.png'
      |LB UID:lbms X:5 Y:95 ALP:1 SHE:1 ROT:0 FGC:#FFFFFF FSZ:2.5 FFA:'font7' TXT:'(c) gammda 2024' 
      
      
      @hls 200
      

      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,1.7,1.1,6' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.8,2.2,8' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'3,3.4,1.8,7' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'2,3.2,1.6,4' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'4,2.3,2.2,4.5' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5,2.2,1.6,4.8' XP:'0,0,0,0'
      @pl1 PLI:'pl0,pl1,pl2,pl3' PLC:'#1ec78e,#06c1f7,#ee9e02,#cd1e2c' YP:'5.4,1.7,1.1,3.4' XP:'0,0,0,0'

      InitF.txt

      posted in Share Your Projects
      G
      gammda
    • MPPT Solar Charger GUI-O Control

      Here is one example of adding an Eyra electronics MPPT-100 MPPT solar charger remote control device.
      [https://www.eyra-elektronika.si/solarni-regulator.htm](link url)

      It's a great product, now I can control it remotely via WiFi and GUI-O.
      I use the RS232 port to communicate with the device.

      5c1f0eae-6a55-4f76-87d5-b2b0b403b7fd-Schema.png

      ece40ecb-8a95-4faf-8fb2-02ce8f914edb-6VP2Pim.png

      5c534bbf-7b3f-4cf9-99e8-c77b3e0e9131-Screenshot_20240808_202503.png

      posted in Share Your Projects
      G
      gammda
    • RE: ESP8266 bugs !!?

      Check the communication lines. Be careful not to connect the RX and TX pins of the ESP8266 together with the Rx and Tx pins of the Bluetooth module.
      I generally use ESP826612F in SMD or Wemos D1 mini version. Sometimes it happened that some information was missing in a very long text. I solve this problem by separating the sent text in two messages on ESP.

      It may also happen that the ESP does not work properly and needs to be replaced with another one. 🙂

      posted in General Discussion
      G
      gammda
    • RE: Audio Mixer Question

      It is possible that you are using a While - Wend loop that never ends because the Sig_Sim parameter is always "0".
      Check your code and change the Sig_sim variable to 1 at some point during runtime.

      Maybe you should try changing the While - Wend with an IF - ENDIF statement.

      Alternatively, maybe modify Ischarwaiting() with serial interrupts something like this:

      On Urxc Rxcom1_isr
      Enable Urxc
      Dim Rxdata1$ As String * 80
      Dim Rxdata As Bit

      Dim Comchar1 As Byte
      Enable Interrupts
      Do

      If Rxdata = 1 Then
      Reset Rxdata1
      Print Rxdata1$ 'do something with your received data
      End If
      Loop

      Rxcom1_isr:
      Comchar1 = Inkey()
      Rxdata1$ = Rxdata1$ + Chr(comchar1)
      If Comchar1 = 13 Then ' detect end of line can be 10 or any other char.
      Set Rxdata
      End If
      Return

      , but it will completely change the concept of your code.

      posted in Share Your Projects
      G
      gammda
    • GUI-O Datalogger

      Hello.
      There is an example Bascom GUI-O Datalogger made on Arduino Nano/ Bluetooth HC06 and GUI-O android application for measurement temperature and humidity using AM2301 sensor.

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

      Application store data in the smartphone, directory
      Code:
      \Phone\Android\data\com.guio.guioapp\files\

      SD card and big processor not required on electronic site.

      Sharing and opening file is also possible direct from application. On phone screen type on filename and opening external application to open stored file.
      Typing on text »Datalogger« performed Init procedure again.
      Type on label www.gui-o.com to visit this for more details.
      In case that temperature is less then 0 C a warning appears - Vibra and tone from smart phone
      In attach is source code, schematic, Prenos.gif picture, which is needed to copy in directory to Android smart phone in the directory:
      Code:
      \ Phone \ Android \ data \ com.guio.guioapp \ files \ Pictures \

      When the button “Start Logging” is pushed, GIF animation start.
      NOTE. When you program Arduino via USB (bootloader) it is recommended that disconnect Rx and Tx pin to HC06.

      There is also Youtube video.

      fb8b8463-fb24-4608-9fe6-62d5182eb2e8-image.png
      4d2dfa12-2190-45e3-be01-781666a7dc12-image.png

      '--------------------------------------------------------------
      '
      '     HW: Arduino Nano ATMEGA 328
      '     GUI-O Datalogger
      '     GUI-O Ver 0.10.1
      '     2021-04-10
      '--------------------------------------------------------------
      
      $regfile = "m328pdef.dat"
      
      $crystal = 16000000
      
      $baud = 9600
      
      $hwstack = 30                                               ' default use 32 for the hardware stack
      $swstack = 30                                               ' default use 10 for the SW stack
      $framesize = 30
      
      Config Serialin = Buffered , Size = 120
      
      Enable Interrupts
      
      ' https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=2543&highlight=gettoken
      $lib "GetToken.Lib"
      $external Gettoken
      Declare Function Gettoken(strinput As String , Byval Bseparator As Byte , Byval Bcount As Byte ) As String
      Dim Sep As Byte
      Dim Pozicija As Byte
      
      '-AM2301 Sensor------------------------------------------------------------
      
      Dht_put Alias Portb.0 : Set Dht_put                         'Sensor pins
      Dht_get Alias Pinb.0
      Dht_io_set Alias Ddrb.0 : Set Dht_io_set
      Dim Data_dht(5) As Byte , Temperature As String * 6 , Humidity As String * 5 , Dht_type As Byte
      Declare Sub Get_humidity()
      
      '--------------------------------------------------------------------------
      
      '-Declaration variables ---------------------------------------------------
      
      Dim Data_key As Byte
      Dim Rdata As String * 100
      Dim Znak As String * 5
      Dim Init As String * 4
      
      Dim Datum As String * 8
      Dim Ura As String * 8
      
      Dim Tempv As Single
      Dim Humv As Single
      
      Dim Flgst As Bit
      Flgst = 0
      
      Dim Filenx As String * 20
      Dim Temperaturex As String * 10
      Dim Humidityx As String * 10
      
      Dim Timeint As Byte
      Dim Sec_t As String * 2
      Dim Sec_v As Byte
      Dim Sec_a As Byte
      Dim Interval As String * 12
      
      
      Gosub R_eep
      Gosub Guio_ini
      
      '-Main ----------------------------------------------------------------------
      
      Main:
      Do
      
         If Ischarwaiting() = 1 Then
            Gosub Read_data
         End If
         Gosub R_eep
         Gosub Time_int
      Loop
      '----------------------------------------------------------------------------
      End
      '----------------------------------------------------------------------------
      Time_int:
        If Timeint = 1 And Flgst = 1 Then
            If Sec_v <> Sec_a Then
              Gosub Write_dat
              Sec_a = Sec_v
            End If
        End If
      
        If Timeint = 10 And Flgst = 1 Then
           Select Case Sec_v
             Case 0 : Gosub Write_dat
             Case 10 : Gosub Write_dat
             Case 20 : Gosub Write_dat
             Case 30 : Gosub Write_dat
             Case 40 : Gosub Write_dat
             Case 50 : Gosub Write_dat
           End Select
      
        End If
      
        If Timeint = 30 And Flgst = 1 Then
           Select Case Sec_v
             Case 0 : Gosub Write_dat
             Case 30 : Gosub Write_dat
           End Select
      
        End If
      
        If Timeint = 60 And Flgst = 1 Then
           Select Case Sec_v
             Case 00 : Gosub Write_dat
           End Select
      
        End If
      
      Return
      '----------------------------------------------------------------------------
      Write_dat:                                                  'writting data on smart phone \Phone\Android\data\com.guio.guioapp\files\
      
       If Sec_v <> Sec_a Then
      
         Print "@ch1 PLI:" ; Chr(34) ; "pl1,pl2" ; Chr(34) ; " PLC:" ; Chr(34) ; "#80c5de, #cd1e2c" ; Chr(34) ; " YP:" ; Chr(34) ; Humidity ; "," ; Temperature ; Chr(34) ; " XP:" ; Chr(34) ; "0,0" ; Chr(34)
         Print "@extf1 FAC:1 FP:" ; Chr(34) ; Datum ; "," ; Ura ; "," ; Temperature ; "," ; Humidity ; Chr(34)
      
         Sec_a = Sec_v
       End If
      
      
      Return
      '-GUI-O Initialization process --------------------------------------
      
      Guio_ini:
      Gosub R_eep
      'Disable Timer1
      Print "@sls"                                                ' hide writing objects
       Print "@cls"                                               ' clear HW components of phone
       Print "@clh"                                               ' clear screen on smart phone
       Print "@guis BGC:#000000 ASR:0.449671"                     ' set beckground- black and resolution of phone"
      
       'Picture:
       'https://www.google.com/search?q=technology+gif&tbm=isch&ved=2ahUKEwi7tbDykfbvAhW95bsIHe4ZDHgQ2-cCegQIABAA&oq=technology+gif&gs_lcp=
       'CgNpbWcQAzIECCMQJzICCAAyAggAMgIIADICCAAyAggAMgIIADICCAAyAggAMgIIADoECAAQQzoGCAAQBxAeUKodWIsyYJ01aABwAHgAgAFNiAGmBZIBAjEwmAEAoAEBqg
       'ELZ3dzLXdpei1pbWfAAQE&sclient=img&ei=ceRyYPu4O73L7_UP7rOwwAc&bih=1184&biw=2379&rlz=1C1CHBD_enSI893SI893&hl=en#imgrc=B0Xz2DikVtub4M&imgdii=7ZOKvs7fe1PToM
      
       'Picture "prenos.gif >> copy this picture on smart phone to directory " \Phone\Android\data\com.guio.guioapp\files\Pictures"
       Print "|IM UID:im1 X:50 Y:40 W:100 H:100 ROT:0 SHE:0 PLS:0 IP:" ; Chr(34) ; "prenos.gif" ; Chr(34)
      
       'Label
       Print "|LB UID:lbname X:45 Y:8 ALP:1 SHE:1 ROT:0 FGC:#42ECF5 FSZ:4.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "GUI-O    Datalogger" ; Chr(34)
      
       'Button Hide because transparent is "0" #0042ECF5 - first 2 data from color
       Print "|BT UID:bt_init X:76 Y:8 W:30 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#00000000 SBGC:#00000000 FSZ:3 FGC:#0042ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "Init" ; Chr(34) ; " SVAL:" ; Chr(34) ; "1" ; Chr(34)
      
       'Button Start/Stop logging
       Print "|BT UID:bt_start X:76 Y:17 W:30 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#000000 SBGC:#000000 FSZ:3 FGC:#42ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "Start Logging" ; Chr(34) ; " SVAL:" ; Chr(34) ; "1" ; Chr(34)
      
       'Label Date and time
       Print "|LB UID:datum X:11 Y:17 ROT:0 SHE:1 ALP:1 FGC:#42ECF5 FSZ:3 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "" ; Chr(34)       'Labela Date
       Print "|LB UID:ura X:33 Y:17 ROT:0 SHE:1 ALP:1 FGC:#42ECF5 FSZ:3 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "" ; Chr(34)       'Labela  Time
      
       'Label for input file name
       Print "|LB UID:lbfilen X:33 Y:29 ROT:0 SHE:1 ALP:1 FGC:#42ECF5 FSZ:3 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; Filenx ; Chr(34)       'Labela   T1
      
       'Button to open file
       Print "|BT UID:bt_filer X:60 Y:29 W:40 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#00000000 SBGC:#00000000 FSZ:3 FGC:#0042ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "" ; Chr(34) ; " SVAL:" ; Chr(34) ; "1" ; Chr(34)
      
       'Label with https home page www.gui-o.com  - parameter URL:1
       Print "|LB UID:lbguio X:33 Y:46.5 ROT:0 SHE:1 ALP:1 URL:1 FGC:#42ECF5 FSZ:2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "www.gui-o.com" ; Chr(34)       'Labela   T1
      
       'Label for interval of storing data
       Print "|LB UID:lbtimiv X:33 Y:33 ROT:0 SHE:1 ALP:1 FGC:#42ECF5 FSZ:3 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; Interval ; Chr(34)       'Labela   T1
      
       'Circular bar for graphical presenting measurement values temperature and Humidity
       Print "|CB UID:temp_i X:72 Y:60 W:43 CE:0 HAW:0 FGC:#cd1e2c SFGC:#cd1e2c BGC:#35444d  BTH:2 LVAL:0 HVAL:50"
       Print "|CB UID:hum_i X:72 Y:60 W:33 CE:0 HAW:0 FGC:#80c5de SFGC:#80c5de BGC:#35444d BTH:2 LVAL:0 HVAL:100"
      
       Print "|LB UID:temp_v X:72 Y:58 FGC:#cd1e2c FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " FSZ:4 TXT:" ; Chr(34) ; "24°C" ; Chr(34)
       Print "|LB UID:hum_v X:72 Y:62 FGC:#80c5de FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " FSZ:4 TXT:" ; Chr(34) ; "25%" ; Chr(34)
      
       'Graph for presenting data
       Print "|CH UID:ch1 X:50 Y:83 W:96 H:25 BTH:0 XTC:4 YTC:5 VIS:0 BGC:#35444d FGC:#42ECF5 RAD:1 CHN:" ; Chr(34) ; "Temperature (°C)    Humidity (%)" ; Chr(34) ; " FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " FSZ:1.8"
      
       Print "|LB UID:lbfilesi X:3 Y:75 ROT:0 SHE:1 ALP:1 VIS:1 FGC:#42ECF5 FSZ:3.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "File name" ; Chr(34)       'Labela   T1
       'Text input for entering data file name
       Print "|TI UID:tifilen X:63 Y:75.5 W:65 ROT:0 SHE:1 VIS:1 BGC:#35444d FGC:#42ECF5 SHE:1 FSZ:3.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " RAD:1 BTH:0.5 TXT:" ; Chr(34) ; Filenx ; Chr(34)
      
       Print "|LB UID:lbtimsi X:3 Y:82 ROT:0 SHE:1 ALP:1 FGC:#42ECF5 FSZ:3.5 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; " TXT:" ; Chr(34) ; "Timer Interval" ; Chr(34)       'Labela   T1
       'Buttons for time intervaling
       Print "|BT UID:bt_1sec X:51 Y:82 W:30 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#000000 SBGC:#000000 FSZ:3 FGC:#cd1e2c SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "1-second" ; Chr(34) ; " SVAL:" ; Chr(34) ; "" ; Chr(34)
       Print "|BT UID:bt_10sec X:51 Y:86 W:30 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#000000 SBGC:#000000 FSZ:3 FGC:#42ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "10-seconds" ; Chr(34) ; " SVAL:" ; Chr(34) ; "" ; Chr(34)
       Print "|BT UID:bt_30sec X:51 Y:90 W:30 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#000000 SBGC:#000000 FSZ:3 FGC:#42ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "30-seconds" ; Chr(34) ; " SVAL:" ; Chr(34) ; "" ; Chr(34)
       Print "|BT UID:bt_1min X:51 Y:94 W:30 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#000000 SBGC:#000000 FSZ:3 FGC:#42ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "1-minute" ; Chr(34) ; " SVAL:" ; Chr(34) ; "" ; Chr(34)
      
       Print "|BT UID:bt_pub X:84 Y:82 W:24 H:5 VIS:1 ROT:0 RAD:1.5 SHE:1 BGC:#000000 SBGC:#000000 FSZ:3 FGC:#42ECF5 SHE:1 BTH:0.2 FFA:" ; Chr(34) ; "font6" ; Chr(34) ; "  TXT:" ; Chr(34) ; "Share" ; Chr(34) ; " SVAL:" ; Chr(34) ; "" ; Chr(34)
      
       'Define file on smart phone to storing data
       Print "|EXTF UID:extf1 HID:extf FAC:0 FNA:" ; Chr(34) ; Filenx ; Chr(34)
      
       'Define RTC on smart phone
       Print "|RTC UID:rtc1 HID:rtc RTCE:1 RTCR:1 RTCF:" ; Chr(34) ; "yy.MM.dd HH:mm:ss" ; Chr(34)       '@rtc1 2018/12/16 20:31:48:242
      
       'Define tone on smart phone
       Print "|TON UID:ton1 HID:ton EDUR:1000 TONT:24"
       'Define Vibration on smart phone
       Print "|VIB UID:vib1 HID:vib EDUR:1000"
      
       'Depends od stored setup setting color of buttons for interval
       If Timeint = 1 Then
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#42ECF5"
       End If
      
      
       If Timeint = 10 Then
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#42ECF5"
      
       End If
      
       If Timeint = 30 Then
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#42ECF5"
      
       End If
      
       If Timeint = 60 Then
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
       End If
      
       Print "@hls 10"                                            'show complete picture on smart phone
       Gosub Ton_vib                                              ' sound and vibra activated
      
      Return
      '-Reading data from serialport from GUI-O ----------------------------
      Read_data:
      
      Data_key = Inkey()
      If Data_key = "@" Then Input Rdata Noecho
           Sep = &H20
           Pozicija = 1
           Znak = Gettoken(rdata , Sep , Pozicija)
      
      If Znak = "bt_start" Then                                   'button start is pressed
      
        Toggle Flgst
        If Flgst = 1 Then
          Print "@bt_start TXT:" ; Chr(34) ; "Stop Logging" ; Chr(34)
          Print "@im1 PLS:1"
          Print "@ch1 VIS:1"
      
          Print "@lbfilesi VIS:0"
          Print "@tifilen VIS:0"
      
          Print "@lbtimsi VIS:0"
          Print "@bt_1sec VIS:0"
          Print "@bt_10sec VIS:0"
          Print "@bt_30sec VIS:0"
          Print "@bt_1min VIS:0"
      
          Print "@bt_pub VIS:0"
      
         End If
      
        If Flgst = 0 Then
          Print "@bt_start TXT:" ; Chr(34) ; "Start Logging" ; Chr(34)
          Print "@im1 PLS:0"
          Print "@ch1 VIS:0"
      
          Print "@lbfilesi VIS:1"
          Print "@tifilen VIS:1"
      
          Print "@lbtimsi VIS:1"
          Print "@bt_1sec VIS:1"
          Print "@bt_10sec VIS:1"
          Print "@bt_30sec VIS:1"
          Print "@bt_1min VIS:1"
          Print "@bt_pub VIS:1"
      
        End If
      
      End If
      
      
      If Znak = "bt_1sec" Then                                    'button 1 second is pressed
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#42ECF5"
      
         Timeint = 1
         Writeeeprom Timeint , &H30
         Gosub R_eep
      
         Print "@lbtimiv TXT:" ; Chr(34) ; Interval ; Chr(34)
      
      End If
      
      If Znak = "bt_10sec" Then                                   'button 10 second is pressed
      
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#42ECF5"
      
         Timeint = 10
         Writeeeprom Timeint , &H30
      
         Gosub R_eep
         Print "@lbtimiv TXT:" ; Chr(34) ; "10-seconds" ; Chr(34)
      
      End If
      
      If Znak = "bt_30sec" Then                                   'button 30 second is pressed
      
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#42ECF5"
      
         Timeint = 30
         Writeeeprom Timeint , &H30
      
         Print "@lbtimiv TXT:" ; Chr(34) ; "30-seconds" ; Chr(34)
      
      End If
      
      If Znak = "bt_1min" Then                                    'button 1 minute is pressed
         Print "@bt_1sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_10sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_30sec BGC:#000000 SBGC:#000000 FGC:#42ECF5"
         Print "@bt_1min BGC:#000000 SBGC:#000000 FGC:#cd1e2c"
      
         Timeint = 60
         Writeeeprom Timeint , &H30
      
         Print "@lbtimiv TXT:" ; Chr(34) ; "1-minute" ; Chr(34)
      
      End If
      
      If Znak = "tifilen" Then                                    'Object TI Text input is confirm
            Sep = " "
            Pozicija = 2
            Filenx = Gettoken(rdata , Sep , Pozicija)
      
            Writeeeprom Filenx , &H10
            Print "@clh"                                          'clear init hardware components on smart phone
            'Again initialization hardware components
            Print "|EXTF UID:extf1 HID:extf FNA:" ; Chr(34) ; Filenx ; Chr(34) ; " FAC:0"
            Print "|RTC UID:rtc1 HID:rtc RTCE:1 RTCR:1 RTCF:" ; Chr(34) ; "yy.MM.dd HH:mm:ss" ; Chr(34)       '@rtc1 2018/12/16 20:31:48:242
      
            Print "|TON UID:ton1 HID:ton EDUR:1000 TONT:24"
            Print "|VIB UID:vib1 HID:vib EDUR:1000"
      
            Print "@lbfilen TXT:" ; Chr(34) ; Filenx ; Chr(34)
            Znak = " "
      
      End If
      
      If Znak = "bt_filer" Then                                   'Open File with external application
            Print "@extf1 FAC:5"
            Znak = " "
      
      End If
      
      If Znak = "bt_pub" Then                                     ' Share File
            Print "@extf1 FAC:7"
            Znak = " "
      
      End If
      
      If Znak = "bt_init" Then                                    ' Init button from application
        Gosub R_eep
        Gosub Guio_ini
      End If
      
      
      If Znak = "Init" Then
        Gosub R_eep
        Gosub Guio_ini
      End If
      
      Init = Mid(rdata , 1 , 4)
      If Init = "init" Then                                       ' Init button with start button
        Gosub R_eep
        Gosub Guio_ini
      End If
      
      If Znak = "rtc1" Then                                       'reading RTC values from phone
        Sep = &H20
        Pozicija = 2
        Datum = Gettoken(rdata , Sep , Pozicija)
      
        Sep = &H20
        Pozicija = 3
        Ura = Gettoken(rdata , Sep , Pozicija)
      
        Sep = ":"
        Pozicija = 3
        Sec_t = Gettoken(ura , Sep , Pozicija)
        Sec_v = Val(sec_t)
      
        Print "@datum TXT:" ; Chr(34) ; Datum ; Chr(34)
      
        Print "@ura TXT:" ; Chr(34) ; Ura ; Chr(34)
        Gosub Meritev
      
      
        If Tempv < 0 Then                                         'In case that temperature is less then 0 degrees
      
         Select Case Sec_v                                        'Alert every 15 seconds
           Case 0 : Gosub Ton_vib
           Case 15 : Gosub Ton_vib
           Case 30 : Gosub Ton_vib
           Case 45 : Gosub Ton_vib
         End Select
        End If
      
      End If
      
      Znak = ""
      Rdata = ""
      
      Return
      
      
      '-Ton Vibra procedures----------------------------------------------------------
      Ton_vib:
         Print "@ton1 EDUR:500"
         Print "@vib1 EDUR:200"
      Return
      '-Measurement of Temperature and Humidity---------------------------------------
      'https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13759&highlight=dht11
      
      Meritev:
      
         Call Get_humidity
          Print "@temp_i VAL:" ; Temperature
          Print "@hum_i VAL:" ; Humidity
      
          Temperaturex = Temperature + "°"
          Humidityx = Humidity + "%"
          Print "@temp_v TXT:" ; Chr(34) ; Temperaturex ; Chr(34)
          Print "@hum_v TXT:" ; Chr(34) ; Humidityx ; Chr(34)
      
      Return
      '-------------------------------------------------------------------------------
      '=============================== DHT11/DHT22 ===================================
      'MCS Forum
      'https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13759&highlight=dht11
      
      Sub Get_humidity()
      
      Local Number_dht As Byte , Byte_dht As Byte , Dht_single As Single
      Set Dht_io_set                                              'bus is output
      Reset Dht_put : Waitms 1                                    'bus=0
      Set Dht_put : Waitus 40                                     'bus=1
      Reset Dht_io_set : Waitus 40                                'bus is input
      If Dht_get = 1 Then                                         'not DHT22?
         Goto Dht11_check                                         'try DHT11
      Else
         Waitus 80
         If Dht_get = 0 Then
            Humidity = "  -  "                                    'DHT22 not response!!!
            Exit Sub
         Else
            Dht_type = 22                                         'really DHT22
            Goto Read_dht_data
         End If
      End If
      Dht11_check:
      Set Dht_io_set                                              'bus is output
      Reset Dht_put : Waitms 20                                   'bus=0
      Set Dht_put : Waitus 40                                     'bus=1
      Reset Dht_io_set : Waitus 40                                'bus is input
      If Dht_get = 1 Then
         Humidity = "  -  "                                       'DHT11 not response!!!
         Exit Sub
      End If
      Waitus 80
      If Dht_get = 0 Then
         Humidity = "  -  "                                       'DHT11 not response!!!
         Exit Sub
      Else
         Dht_type = 11                                            'really DHT11
      End If
      Read_dht_data:
      Bitwait Dht_get , Reset                                     'wait for transmission
      For Number_dht = 1 To 5
         For Byte_dht = 7 To 0 Step -1
            Bitwait Dht_get , Set
            Waitus 35
            If Dht_get = 1 Then
               Data_dht(number_dht).byte_dht = 1
               Bitwait Dht_get , Reset
            Else
               Data_dht(number_dht).byte_dht = 0
            End If
         Next
      Next
      Set Dht_io_set : Set Dht_put
      If Dht_type = 22 Then                                       'CRC check
         Byte_dht = Data_dht(1) + Data_dht(2)
         Byte_dht = Byte_dht + Data_dht(3)
         Byte_dht = Byte_dht + Data_dht(4)
      Else
         Byte_dht = Data_dht(1) + Data_dht(3)
      End If
      If Byte_dht <> Data_dht(5) Then
         Temperature = "error"
         Humidity = "error"                                       'CRC error!!!
      Else
         If Dht_type = 22 Then
            Dht_single = Data_dht(1) * 256
            Dht_single = Dht_single + Data_dht(2)
            Dht_single = Dht_single / 10
      
            Humidity = Fusing(dht_single , "#.#")
            If Data_dht(3).7 = 1 Then
               Data_dht(3).7 = 0
               Temperature = "-"
            Else
               Temperature = ""
            End If
            Dht_single = Data_dht(3) * 256
            Dht_single = Dht_single + Data_dht(4)
            Dht_single = Dht_single / 10
      
            Temperature = Temperature + Fusing(dht_single , "#.#")
      
            Tempv = Val(temperature)
            Humv = Val(humidity)
         Else
      
      
         End If
      End If
      
      End Sub
      
      '-Read data from EEPROM-------------------------------------------------------
      R_eep:
      Readeeprom Filenx , &H10
      Readeeprom Timeint , &H30
      
      Select Case Timeint
        Case 1 : Interval = "1-second"
        Case 10 : Interval = "10-seconds"
        Case 30 : Interval = "30-seconds"
        Case 60 : Interval = "1-minute"
      End Select
      
      Return
      '-----------------------------------------------------------------------------
      
      posted in Share Your Projects
      G
      gammda