1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Update docs

This commit is contained in:
Rhys Weatherley
2015-03-12 19:03:15 +10:00
parent 083448f195
commit c6206e4216
493 changed files with 35310 additions and 3018 deletions

View File

@@ -3,6 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ArduinoLibs: Alarm Clock</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
@@ -29,7 +30,7 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
@@ -80,7 +81,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="contents">
<div class="textblock"><h1><a class="anchor" id="clock_features"></a>
Features</h1>
<p>The alarm clock described on this page is a large example application that uses many of the classes in the provided libraries: <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a>, <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields.">Form</a>, <a class="el" href="classField.html" title="Manages a single data input/output field within a Form.">Field</a>, <a class="el" href="classSoftI2C.html" title="Bit-banged implementation of an I2C master.">SoftI2C</a>, <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a> (or <a class="el" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a>), <a class="el" href="classMelody.html" title="Plays a melody on a digital output pin using tone().">Melody</a> and <a class="el" href="group__power__save.html">PowerSave</a>. The clock has the following features:</p>
<p>The alarm clock described on this page is a large example application that uses many of the classes in the provided libraries: <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a>, <a class="el" href="classForm.html" title="Manager for a form containing data input/output fields. ">Form</a>, <a class="el" href="classField.html" title="Manages a single data input/output field within a Form. ">Field</a>, <a class="el" href="classSoftI2C.html" title="Bit-banged implementation of an I2C master. ">SoftI2C</a>, <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C. ">DS1307RTC</a> (or <a class="el" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C. ">DS3232RTC</a>), <a class="el" href="classMelody.html" title="Plays a melody on a digital output pin using tone(). ">Melody</a> and <a class="el" href="group__power__save.html">PowerSave</a>. The clock has the following features:</p>
<ul>
<li>Displays both the time and date. </li>
<li>12 hour and 24 hour time display modes. </li>
@@ -94,16 +95,16 @@ Features</h1>
</ul>
<h1><a class="anchor" id="clock_main_circuit"></a>
Main circuit</h1>
<p>The main clock circuit consists of an Arduino Uno compatible board, a 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> module, a realtime clock chip, a piezo buzzer for the alarm, and a MOSFET for controlling the radio:</p>
<p>The main clock circuit consists of an Arduino Uno compatible board, a 16x2 <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> module, a realtime clock chip, a piezo buzzer for the alarm, and a MOSFET for controlling the radio:</p>
<div class="image">
<img src="alarm_circuit.png" alt="alarm_circuit.png"/>
</div>
<p>Some of the components can be purchased ready-made as the <a href="http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide">Freetronics 16x2 LCD Shield</a> and the <a href="http://www.sparkfun.com/products/99">SparkFun Realtime Clock Module</a>. I used the ready-made realtime clock module, but made my own equivalent to the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> shield from parts to aid in spacing out the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a> and pushbuttons on the exterior of the box. The value of the 33R resistor may need to be adjusted for different types of back light LED's. See <a class="el" href="alarm_clock.html#clock_ds3232">below</a> for information on using a DS3232-based clock module instead of a DS1307-based module.</p>
<p>The whole circuit is built on a prototyping shield, with ribbon cables connecting to the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a>. The Stop Alarm button, piezo buzzer, and radio controller are not shown in this picture and some of the components are soldered to the bottom of the shield:</p>
<p>Some of the components can be purchased ready-made as the <a href="http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide">Freetronics 16x2 LCD Shield</a> and the <a href="http://www.sparkfun.com/products/99">SparkFun Realtime Clock Module</a>. I used the ready-made realtime clock module, but made my own equivalent to the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> shield from parts to aid in spacing out the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a> and pushbuttons on the exterior of the box. The value of the 33R resistor may need to be adjusted for different types of back light LED's. See <a class="el" href="alarm_clock.html#clock_ds3232">below</a> for information on using a DS3232-based clock module instead of a DS1307-based module.</p>
<p>The whole circuit is built on a prototyping shield, with ribbon cables connecting to the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a>. The Stop Alarm button, piezo buzzer, and radio controller are not shown in this picture and some of the components are soldered to the bottom of the shield:</p>
<div class="image">
<img src="clock_shield.jpg" alt="clock_shield.jpg"/>
</div>
<p>The clock module is based on the DS1307 chip and has an on-board coin battery to keep the time and date ticking over even if the main circuit loses power. The chip is I2C-based and has an auxillary SQW output that can be configured to provide a 1 Hz squarewave signal. This signal is used by the software running on the Arduino to detect when a new time or date is available for display on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields.">LCD</a>. The <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C.">DS1307RTC</a> class takes care of the details of talking to the chip via I2C.</p>
<p>The clock module is based on the DS1307 chip and has an on-board coin battery to keep the time and date ticking over even if the main circuit loses power. The chip is I2C-based and has an auxillary SQW output that can be configured to provide a 1 Hz squarewave signal. This signal is used by the software running on the Arduino to detect when a new time or date is available for display on the <a class="el" href="classLCD.html" title="Enhanced library for Freetronics 16x2 LCD shields. ">LCD</a>. The <a class="el" href="classDS1307RTC.html" title="Communicates with a DS1307 realtime clock chip via I2C. ">DS1307RTC</a> class takes care of the details of talking to the chip via I2C.</p>
<h1><a class="anchor" id="clock_arduino_board"></a>
Arduino board</h1>
<p>To keep power consumption low, say for being powered by batteries, we don't need a full Arduino Uno or similar board. The USB interface is unnecessary, as is the on-board power supply if there is an external source of 5 volt power. We also don't want the power and D13 status LED's to be draining power. Therefore, a cut-down version of the Arduino is recommended. We used the <a href="http://www.freetronics.com/collections/arduino/products/kitten">KitTen</a> kit from <a href="http://www.freetronics.com/">Freetronics</a>, and didn't solder up anything that wasn't strictly necessary. A <a href="http://www.freetronics.com/ftdi-cable">5v FTDI USB-to-Serial cable</a> is necessary for programming. Similar minimalistic built-it-yourself Arduino designs should also work.</p>
@@ -121,7 +122,7 @@ Controlling a radio</h1>
<h1><a class="anchor" id="clock_ds3232"></a>
Using DS3232 instead of DS1307</h1>
<p>For clock modules based on the DS3232 chip, such as the <a href="http://www.freetronics.com/products/real-time-clock-rtc-module">Freetronics Real Time Clock Module</a>, change the <code>Clock</code> typedef in <code>Clock.h</code> to the following:</p>
<div class="fragment"><div class="line"><span class="keyword">typedef</span> <a class="code" href="classDS3232RTC.html" title="Communicates with a DS3232 realtime clock chip via I2C.">DS3232RTC</a> Clock;</div>
<div class="fragment"><div class="line"><span class="keyword">typedef</span> <a class="code" href="classDS3232RTC.html">DS3232RTC</a> Clock;</div>
</div><!-- fragment --><p>The pads on the Freetronics module should be connected to the Arduino as follows:</p>
<ul>
<li>VCC and GND connected to 5V and GND on the Arduino. </li>
@@ -139,9 +140,9 @@ Completed Clock</h1>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Sep 29 2013 09:30:46 for ArduinoLibs by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Thu Mar 12 2015 19:02:05 for ArduinoLibs by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</a> 1.8.6
</small></address>
</body>
</html>