DS1307 Support and demo program v2 with ZBasic structures

Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
Post Reply
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

DS1307 Support and demo program v2 with ZBasic structures

Post by stevech »

ZBasic now has (beta test) support for structures.

The attached code uses simple structures for date/time in conjunction with the DS1307 clock chip (I2C bus).

Three bas files
1. Test and demo - set time via PC batch file
2. DS1307 I/O
3. Leap year and other date/time utilties :)
Attachments
DS1307Testv2.zip
(8.81 KiB) Downloaded 3393 times
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

You are getting good at this stuff :)

I would suggest moving the structure from the test program to the interface module because it is part of the interface.
Mike Perks
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

or put the structure in a file by itself and #include it whenever needed - like you do in C
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

Well that is possibly true because it is such a common and useful structure. But in other cases I like to use the encapsulation provided by the modules - think C++ rather than C ;)
Mike Perks
Post Reply