Shop OBEX P1 Docs P2 Docs Learn Events
My first P1 code: PST Clock with Date and Time — Parallax Forums

My first P1 code: PST Clock with Date and Time

Hey. I'm new to the P1. About half way through the P1 Education Kit pdf. I wrote my first P1 code which is attached. I have basic programming skills.

This is a PST clock that shows the Date and Time in 24 hour format. You will need to hook PINS 0-5 up to 6 momentary push buttons that pull the input low. I'm doing this on the PPDB. Holding PIN 5 low for 2 seconds will enter a mode to adjust the date and time. PINs 0-4 adjust the date and time. Momentary press or hold the push button. Holding Pin 5 low for 2 seconds will exit the adjust mode. Two pictures of the PST clock display are attached. The first is the normal display. The second is "adjust" mode, where "Clock Adjust Enabled" flashes. Two cogs are used in this code, to allow the clock adjust without needing the waitcnt to finish.

I plan to learn how to drive segmented LEDs next with this code.

Thanks for looking. Feel to use, discard, or comment on. It seems to be working well.

Macho Man Randy Savage (AKA Nick AKA Ludis)
631 x 285 - 7K
632 x 279 - 8K

Comments

  • Well done! Please be sure to post your results with the segmented displays!
  • JRoark wrote: »
    Well done! Please be sure to post your results with the segmented displays!

    thank you! Will do. Might be a while lol
  • Well, back in the day like early 70's that use to be a first project people would do except we used discrete circuits like JK flip flops, BCD Counters and 7 segment display drivers. Now a days you can write that in firmware.

    Writing a 7 segment display driver could also be a fun projects as you need to map each segment to a pin and drive the right pin at the right time. Parallax has one of these here. It looks like it comes with examples.

    The other option is to program a set like this which I believe was featured recently.

    Mike
  • iseries wrote: »
    Well, back in the day like early 70's that use to be a first project people would do except we used discrete circuits like JK flip flops, BCD Counters and 7 segment display drivers. Now a days you can write that in firmware.

    Writing a 7 segment display driver could also be a fun projects as you need to map each segment to a pin and drive the right pin at the right time. Parallax has one of these here. It looks like it comes with examples.

    The other option is to program a set like this which I believe was featured recently.

    Mike

    This would be much more difficult with discrete circuits! thanks for the links, I purchased both. The next jonnymac forum with that segmented LED is next week! I signed up. Great timing!
Sign In or Register to comment.