Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Newie got a few questions Post ReplyPost New Topic
<< Prev Page of 33
Author
Message << Prev Topic | Next Topic >>
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 06 December 2017 at 11:26pm | IP Logged Quote lew247

Thanks Panky

On a different subject again

I have a picture displayed on the lcd screen showing various information
What I would LIKE to do is
IF my outdoor unit lost the GPS lock
or was faulty - not sending information for a set period of time

display a message on the Explore 100 lcd
similar to
Text 150,150,"GPS LOCK LOST" , LM, 2, 3, RGB(BLACK), RGB(WHITE) 'Print the weather description
or
Text 150,150,"Outdoor unit FAULTY" , LM, 2, 3, RGB(BLACK), RGB(WHITE) 'Print the weather description
BUT
I'd like to remove the text after a set period of time and have the original picture show
Is there a way to remove text without having to load the picture fully again?



Back to Top View lew247's Profile Search for other posts by lew247
 
lew247
Guru
Guru
Avatar

Joined: 23 December 2015
Location: United Kingdom
Online Status: Offline
Posts: 790
Posted: 06 December 2017 at 11:56pm | IP Logged Quote lew247

I sorted the problem partly by using led's on the screen, its easy to turn them on and off

Is there a way to set a timer on a serial port so that if nothing is received within a set period of time it then does something such as change a ctrlval
Back to Top View lew247's Profile Search for other posts by lew247
 
goc30
Newbie
Newbie
Avatar

Joined: 12 April 2017
Location: France
Online Status: Online
Posts: 13
Posted: 07 December 2017 at 12:10am | IP Logged Quote goc30

you must use a time-out couter


'------------------
'init var
dim tcpt1 as integer  'value of time out counter
dim tcpt2 as integer   'value of display counter
dim tcptmax as integer   'value max of time out
dim tcptmax2 as integer   'value of display time
SETTICK 100, gpsto  (or settick 100, gpsto,x  'x=n couter if use more than 1 coutner

'---------------
'in setup 
tcpt1=0
tcptmax=30  'wait 3 sec time out
tcptmax2=50  'display msg during 5 sec

'-------------------
'after gps on
tcpt1=1   to begin couting
'-------------------
'in main loop
'...
'... others tasks  
'...
' if not use COM time-out you must put this
tcpt1=1  'for begin couting time out "no response"
'gps read  'and goto read COM gps
'
'if gps value is correct
tcpt1=1   'raz time-out
tcpt2=0   'raz display
'...
'... 
'----------------
'in interrupt sp
gpsto:
if tcpt2=0 then
      tcpt2=1   'flag display is done
      Text 150,150,"           " , LM, 2, 3, RGB(BLACK), RGB(WHITE) 'Print the
end if

if tcpt1<tcptmax then
   if tcpt1>0 then tcpt1=tcpt1+1
else
   if tcpt1=tcptmax then
       tcpt1=tcpt1+1  'to indicat timeout is on and no display next time
       Text 150,150,"GPS LOCK LOST" , LM, 2, 3, RGB(BLACK), RGB(WHITE) 'Print
       tcpt2=1  'begin counting display time
            'and add other instruct if necessary
   else
       if tcpt2<tcptmax2 then
          if tcpt2>0 then tcpt2=tcpt2+1
       else
          tcpt2=0  'for raz display in next loop
       end if
   end if
end if

ireturn


if you work in interrupt mode for gps, it is more easy
you need to put a flag "gps ok", or put cpt1 to 1 (and cpt2 to zero if not) after decoding ans control string gps



Edited by goc30 on 07 December 2017 at 12:33am
Back to Top View goc30's Profile Search for other posts by goc30
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
<< Prev Page of 33
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.0940 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.09