Author Topic: Displaying Time to LCD  (Read 3510 times)

0 Members and 1 Guest are viewing this topic.

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Displaying Time to LCD
« Reply #25 on: August 28, 2020, 09:42:59 am »
Done with my OnePlus 7T. We had a nice summer, this year  :) Even a bit too hot for us !
 

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #26 on: August 28, 2020, 04:17:41 pm »
ggchab<<

Hi there.
I am sorry that I am killing your time.
Would you please give me an idea how to decrease time setting values? You know the program works correctly when time setting value is increased using push button. But when I try to decrease time value it does not decrease even I press push buttons (MENU_sw+HRS_sw). That means the time settings can go ++ ; bot can not go --.

A partial relevant code segment is like the following-
///////////////////////////////////////////////////////////////////////
if (start) {                          // If timer is running
    //INTCON.T0IF = 0;
   if ((!MIN_sw) || (!HRS_sw)){
    Delay_ms(100);
    if ((!MIN_sw) || (!HRS_sw)){
     //EEPROM_Write(0x16,1);
     //Delay_ms(50);
     a = 1;
     
     if ((!MENU_sw) && (!MIN_sw)) {       // MENU+MIN buttons are PRESSED, minutes value decreases
      if (minutes > 0) minutes--;              // This does not work. The value does not change at all !!
      else minutes = 0;
      }
     
     if (!MIN_sw) {            // MIN button is PRESSED minute value increases (this works)
      if (minutes < 59) minutes++;
      else minutes = 0;
     } .........
Current complete timer code is attached for your perusal. Please see from Line# 304 to 344.
Do you notice any mistake in the program code?

Thanks again.


« Last Edit: August 28, 2020, 04:31:36 pm by asadulhuq »
 

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #27 on: August 28, 2020, 04:55:38 pm »
ggchab<<
How could you shoot such a wide area with the OnePlus 7T? Interesting. I have to see the specs of the device! I am a poor man and old at the same time  :). I am still using Samsung Galaxy S8!
« Last Edit: August 28, 2020, 04:58:03 pm by asadulhuq »
 

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Displaying Time to LCD
« Reply #28 on: August 28, 2020, 07:34:47 pm »
I think that because as soon as minutes-- is executed, minutes++ is also executed because (MIN_sw == 0) is also true in the next test!

minutes should only be incremented when (!MIN_sw) &&(MENU_sw)

Code: [Select]
     if ((!MENU_sw) && (!MIN_sw)) {            // MENU+MIN buton is PRESSED
      if (minutes > 0) minutes--;
      else minutes = 0;
      }
     
     if ((MENU_sw) && (!MIN_sw)) {            // MIN buton is PRESSED ... AND MENU IS NOT PRESSED
      if (minutes < 59) minutes++;
      else minutes = 0;
     }
 
The following users thanked this post: asadulhuq

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Displaying Time to LCD
« Reply #29 on: August 28, 2020, 07:44:22 pm »
I love my OnePlus 7T  :) I bought it end of last year.

My previous smartphone was a Galaxy S6. But it was getting slower and slower and I had to charge it several times during the day ! I could not believe my eyes when I saw the responsiveness of the OnePlus.

I hope 60 is not that old. I am 58  ;D
 

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #30 on: August 29, 2020, 01:41:58 am »
ggchab<<
"I hope 60 is not that old. I am 58."
very strange! I thought programming was for younger people.
Thanks. I will try your suggestion.
« Last Edit: August 29, 2020, 02:52:45 am by asadulhuq »
 

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #31 on: August 29, 2020, 03:12:07 am »
ggchab<<
Good morning from my end.
Excellent!! You are very correct. Now --  and also ++ work perfectly. Lot of thanks.
BTW, may I ask about your profession? Are you a professional programmer?

 

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Displaying Time to LCD
« Reply #32 on: August 29, 2020, 08:07:12 am »
I have a scientific background. I bought a TRS-80 when I was a student. I learned Basic and Z80 assembly.
I have always worked in small IT services (help desk, system administrator, ...) where everyone has to to everything. So, I have never been a specialist in any domain but know a bit of many things ...

About 15 years ago, I discovered micro-controllers and made some little hobbyist projects based on 16F84, in assembly. Then I moved to PIC18F ... still in assembly. Then, almost nothing. More recently (after some experiments with Arduino to help my son in his studies), I decided to do some projects with graphic LCD and moved to 16 bit PIC and, of course, I switched to C. That's a lot of fun  ;D
 
The following users thanked this post: asadulhuq

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #33 on: September 06, 2020, 06:52:17 am »
ggchab<<

Hi there,

I have completed a prototype of the timer on breadboard. Seems that it is working. Thanks for your assistant for making it a reality! If you have some time you may please visit the following link where a small video clip of the project resides.

https://drive.google.com/drive/folders/1gEundQwoAl1aE1_OfRxhJYHAy4HWFR_j?usp=sharing
 

Offline ggchab

  • Frequent Contributor
  • **
  • Posts: 276
  • Country: be
Re: Displaying Time to LCD
« Reply #34 on: September 06, 2020, 03:54:42 pm »
That seems to work well  :-+
Do you plan to make a PCB ?
 
The following users thanked this post: asadulhuq

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #35 on: September 06, 2020, 06:07:39 pm »
ggchab<<

Hi there,
Eventually, I intend to make the PCB. I like EasyEda. However, currently EazyEda PCBs can not reach Bangladesh in time, may be communication with China has not restored as it was before. Also, Bangladesh post offices do not work well due to Covid 19. In Bangladesh, PCB manufacturing quality is not acceptable to me. So, I am not sure what to do.

Also, I tried to design the PCB with Proteus itself. Proteus is a good simulation software but in case of designing PCBs, Proteus 8 is not that good. Many footprints are not readily available in Proteus. For example some popular relay footprints are not available. In contrast, EasyEda has a big collection of devices and corresponding foot prints.

So, about PCB, I am not sure what to do. May be I can make myself one (not up to the mark!).

Also, a good project box will be required. It is difficult to get project box parts due to Covid here. May be, I can find PC power supply boxes like before. But that may look odd! By the way, I shall attach a SonOFF Pow device with the timer. (Just for your information, Sonoff devices are smart but can not do simple thing like a count down timer!).

Thanks.   
« Last Edit: September 06, 2020, 06:09:51 pm by asadulhuq »
 

Offline Lindley

  • Regular Contributor
  • *
  • Posts: 195
  • Country: gb
Re: Displaying Time to LCD
« Reply #36 on: September 06, 2020, 07:42:05 pm »
Hi,

Are you just wanting one pcb for yourself or going into production ?

Once a design has been proved in simulation its always best to build a fully soldered prototype, usually just hand wired onto Vero or Dot Matrix board, so you can run the circuit for some days to fully prove it works as intended.

If done neatly it can serve as your final build, as I often do for my own projects, but if going into production you need to prove your design 100% before ordering a lot of PCBs.

Know quiet a few folk who rush to get a pcb done, only to find the circuit does not work becuase of their errors,  so end up hacking loads of tracks !


 

Offline asadulhuqTopic starter

  • Contributor
  • Posts: 36
  • Country: bd
Re: Displaying Time to LCD
« Reply #37 on: September 07, 2020, 02:17:47 am »
I am not going for a commercial production. I shall  make one for home use. This is purely a hobby project. It will be a pleasure to use things made by myself. Nothing more than that.
You are 100% correct about veroboard implementation. Currently I am using an analog count down timer with my Geyser (home water heater). That is in use for about last 1 year without any malfunction (you have seen it sitted in a PC power supply box!). That timer is built on a veroboard and working for over 1 year.
So, your advice is correct. A pcb is not essential for one piece.
I already ordered veroboards like you have shown in your post. Thanks for the photo.

But, I need a project box. Currently I can get only a PC power supply box!

Thanks again.


 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Displaying Time to LCD
« Reply #38 on: September 07, 2020, 05:47:17 am »
Before plastic instrument cases became ubiquitous, hobbyists built wooden boxes for their projects.  I'd be very surprised if you cant get the materials to build such boxes locally, or even find a craftsman who can build you nicer boxes than you ever could at a reasonable price.   Its often easiest to use sheet metal for the front panel for ease of mounting controls etc. which are usually only suited to a limited panel thickness. 
 
The following users thanked this post: asadulhuq


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf