EASy68K  
It is currently Tue Dec 10, 2019 12:59 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Talking clock
PostPosted: Sun Oct 10, 2010 1:57 pm 
Offline

Joined: Sun Oct 10, 2010 1:15 pm
Posts: 7
Location: Johor
hi, wanna make the clock to speak out as showed on the 7-segments. The time is shows as PC time. No interrupt needed. It will speak out every minutes change. But how to make sure it will speak out after 10 seconds once every minutes change? Any suggestion on this topic?
Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 10, 2010 7:01 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1109
From the clockDigital.X68 program in the EASy68K examples folder:

Code:
* display minutes as digits
   move.b   d6,d0
   bsr   Hex2BCD
   move.b   #0,d3         0 digit code
   if.b d0 <hi> #9 then.s   if minutes > 9
      move.b   d0,d3
      lsr.b   #4,d3      10's minute digit
   endi
   bsr   segment7
   move.b   d0,d3
   and.b   #$F,d3         1's minute digit
   bsr   segment7

at this point register D7 contains the seconds. If D7 is 0 then a new minute has just elapsed.

clockWithSound.X68 has some example code for playing wav files.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 11, 2010 12:36 am 
Offline

Joined: Sun Oct 10, 2010 1:15 pm
Posts: 7
Location: Johor
I did use the example. but i need to set after 10 seconds, it will speak out the time from hour to minutes. Where should i place the sound, so it will not overlapping. For example; 10:30pm -> "Ten and a half morning"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 11, 2010 3:27 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1109
If you want to play a sound every 10 seconds then look at the value in register D7 or the seconds variable. If D7/10 is 0 then play the sounds.

I would play the sounds after the display has finished updating.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 11, 2010 7:38 am 
Offline

Joined: Sun Oct 10, 2010 1:15 pm
Posts: 7
Location: Johor
I dont want it sound for every 10 seconds. I want it speaks out on every ten second change on the minute. i also want it sound after all is updated. But where should i store or keep the memory since the memory in D3 is always change at HOUR, MINUTE and SECOND part. How to let it sound after updating so the sound will not overlapping?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 11, 2010 11:52 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1109
Use a subroutine to play the sounds. At the top of the routine use the movem.l instruction to save all the registers you need to use and restore them at the bottom of the routine. This will prevent the subroutine from interfering with the existing code.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 12, 2010 12:26 am 
Offline

Joined: Sun Oct 10, 2010 1:15 pm
Posts: 7
Location: Johor
Thanks prof.
Trying


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group