Making a BS2 Controlled Alarm Clock? Or even Clock?
I thought this would be an intresting experiment, so im curious to know just what I might need to emulate a real clock. I could probably be able to code for half of it but im totally stumped on part of the circutry. Any ideas?
Comments
http://www.parallax.com/detail.asp?product_id=604-00005
8 - * * * *
4 - * * . * *
2 - * * . * *
1 - * * * *
Each * is a led, and they are lit up in order to show the time in 00:00 format (after binary conversion, as show by the numbers).
Heres the 60-Second portion of code I worked on:
What im intrested in knowing, is if theres a way to use some kind of For..Next coding to replace the bulky gosub's and high sequences. I'll probably check the Nuts and Volts pages, but if anyone knows a specific page on that, do tell
Post Edited (Emission) : 6/30/2006 3:07:29 AM GMT
Thats intresting, im gonna look into that. Thanks.
http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=53
I like Nitin's RTC because of its small size and it has mounting holes I can easily mount it to my BOE bot. It also doesn't take up any breadboard space (except the 4.7k pullup resistors for the I2C communication).
Matt
high i
pause 1000
low i
next
for i = 5 to 4
high i
pause 1000
low i
next
Off the top of my head (warning, the top of my head is bald)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I'll post something in a few minutes that should work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
This code itself only takes up 7% of the EEPROM so theres plenty of room for the rest of the sequences, and the actual clock coding.
No need to go through all the gymnastics you're performing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
·······················································································
I am with you on this one
I·would like to know this my self··
Can you give me an example of how I would use outb?
And, is outb applicable for all pins 0 - 15?
I reading this POST·to see what comes out of this
This might be a cool project
SSteve·said this
outb·=·whateverValue
Please explane whateverValue are you meaning binary #
If I want to display time in a 1 2 4 8 binary format (where its read by reading the sum of the digits, as binary is read is this what you are taking about whateverValue
Thanks to anyone that can help me understand how to do this and Thank You for your Time
Sam···
Rafael
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You've got to play the game.
You can't win.
You can't break even, except on a very cold day.
It doesn't get that cold.
~Laws of Thermodynamics~
inb/outb = pins 4-7
inc/outc = pins 8-11
ind/outd = pins 12-15
inl/outl = pins 0-7
inh/ouh = pins 8-15
ins/outs = pins 0-15
will set pins 4, 5, & 6 to high and pin 7 to low.
This is described in the BASIC Stamp reference manual under "Memory Organization"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
http://forums.parallax.com/showthread.php?p=552892
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
The LED's just wont light up, I don't understand. Am I doing something wrong?
And no, I haven't seen that project, but it looks cool. Think I can reduce the size of that whole setup to the size of a watch?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Man, without your help id be so lost, but look, I reduced those gymnastics to 8 lines of efficient code. The Pause phase will be replaced by a counter that keeps track of the time and convert the decimal values to binary coding for the display. Its looking a lot easier now that I have this down-pat. I'll get back to you guys when I have the final coding written out.
has exactly the same effect as
so your code can be reduced to this:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
The INIT_VAL line tells the clock to start at 12:00 (hrcyc1 = 1 & hrcyc0 = 2, hrcyccheck is the checking system). The hrcyccheck variable is used to check to make sure the clock rolls over to 01:00 when the clock reaches 12:59:59. This code takes up a mere 6% of EEPROM but if you can shorten this code, feel free. The clock works %100 to my knowledge (the right LED's light up at the right time), but there might be one or two bugs that I haven't noticed. I went through and wrote the program fairly quickly so im not %100 sure. I'll get back to you guys with the final pictures of the working clock
By the way, that project that chris is doing, he's cheating a little by using a time keeper IC and other IC's. I did the entire functions of my clock within the BS2, the only external circutry consists of the LED's.
Now that this project is consdered DONE, I'm gonna go revise Chris's project a little
Post Edited (Emission) : 7/2/2006 5:48:07 AM GMT
MIN_CLR
mincyc1 = 0
GOTO HR_CYC0
RETURN
HR_CYC0
hrcyc0 = hrcyc0 + 1
You can leave out the lines in red.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows
links:
My band's website
Our album on the iTunes Music Store
Please don't be to quick to judge one persons project over another. Let me assure you, Chris isn't cheating by using an external IC for his clock. Since none of the PBASIC Stamps have an accurate timebase built-in, the only proper way to keep time, and have alarms is with an external IC.
You will find that the longer your program operates the more INACCURATE it will become. Additionally, the solution Chris has chosen will be much more accurate over varied temperatures, as well as over longer periods of time.
Add to that the ability to set and reset the exact time which Chris has, and you do not. Moreover, Chris has the date handy as well, and you do not. Last is the issue of daylight savings time (if that is applicable to you) and year 2000 compatibility (Y2K).
If you were to change the resonator on the Stamp to a crystal, you might end up with a more accurate timebase, but you'd still have the other "features" to contend with.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 7/2/2006 6:29:15 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com