Bible eBook Prototype More details at: http://mbed.org/users/davervw/notebook/ebible-abstract/

Dependencies:   SDHCFileSystem TextLCD mbed BibleIO

Committer:
davervw
Date:
Sun Feb 27 18:54:37 2011 +0000
Revision:
0:b9d9145827e2
NXP mbed Design Challenge Entry

Who changed what in which revision?

UserRevisionLine numberNew contents of line
davervw 0:b9d9145827e2 1 /* KJV Bible eBook Browser
davervw 0:b9d9145827e2 2 *
davervw 0:b9d9145827e2 3 * Copyright (c) 2011 David R. Van Wagner davervw@yahoo.com
davervw 0:b9d9145827e2 4 *
davervw 0:b9d9145827e2 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
davervw 0:b9d9145827e2 6 * of this software and associated documentation files (the "Software"), to deal
davervw 0:b9d9145827e2 7 * in the Software without restriction, including without limitation the rights
davervw 0:b9d9145827e2 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
davervw 0:b9d9145827e2 9 * copies of the Software, and to permit persons to whom the Software is
davervw 0:b9d9145827e2 10 * furnished to do so, subject to the following conditions:
davervw 0:b9d9145827e2 11 *
davervw 0:b9d9145827e2 12 * The above copyright notice and this permission notice shall be included in
davervw 0:b9d9145827e2 13 * all copies or substantial portions of the Software.
davervw 0:b9d9145827e2 14 *
davervw 0:b9d9145827e2 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
davervw 0:b9d9145827e2 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
davervw 0:b9d9145827e2 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
davervw 0:b9d9145827e2 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
davervw 0:b9d9145827e2 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
davervw 0:b9d9145827e2 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
davervw 0:b9d9145827e2 21 * THE SOFTWARE.
davervw 0:b9d9145827e2 22 */
davervw 0:b9d9145827e2 23
davervw 0:b9d9145827e2 24 #include <mbed.h>
davervw 0:b9d9145827e2 25 #include "SDHCFileSystem.h"
davervw 0:b9d9145827e2 26 #include "TextLCD.h"
davervw 0:b9d9145827e2 27 #include "BibleIO.h"
davervw 0:b9d9145827e2 28 #include "BibleUI.h"
davervw 0:b9d9145827e2 29
davervw 0:b9d9145827e2 30 //Serial console(USBTX, USBRX);
davervw 0:b9d9145827e2 31
davervw 0:b9d9145827e2 32 int main()
davervw 0:b9d9145827e2 33 {
davervw 0:b9d9145827e2 34 //console.baud(921600); // mbed to pc usb serial supports: 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600
davervw 0:b9d9145827e2 35 //console.printf("Bible\n");
davervw 0:b9d9145827e2 36
davervw 0:b9d9145827e2 37 TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD8x2); // rs, e, d4, d5, d6, d7, LCD type
davervw 0:b9d9145827e2 38 //lcd.printf("Bible\n");
davervw 0:b9d9145827e2 39
davervw 0:b9d9145827e2 40 SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sclk, cs, mount point
davervw 0:b9d9145827e2 41 BibleIO HolyBible("/sd/bible.txt", BibleUI::indexing, &lcd);
davervw 0:b9d9145827e2 42
davervw 0:b9d9145827e2 43 DigitalIn left(p21);
davervw 0:b9d9145827e2 44 DigitalIn right(p22);
davervw 0:b9d9145827e2 45 left.mode(PullDown);
davervw 0:b9d9145827e2 46 right.mode(PullDown);
davervw 0:b9d9145827e2 47
davervw 0:b9d9145827e2 48 // go UI
davervw 0:b9d9145827e2 49 BibleUI ui(HolyBible, lcd, left, right); // Bible, TextLCD, left button, right button
davervw 0:b9d9145827e2 50 ui.start();
davervw 0:b9d9145827e2 51 }