Code Monkey home page Code Monkey logo

alarmpi's Introduction

AlarmPi

Demo files for Alarm Pi board from AB Electronics UK

run the following commands to setup the module

sudo modprobe i2c-dev
sudo modprobe rtc-pcf8563

The RTC Pi requires a Linux kernel with i2c drivers such as the Occidentalis system image from http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/overview which has i2c enabled.

To access the Alarm Pi from your Raspberry Pi:

Boot the Pi from that image and execute these commands as root / su user:

First you need to register the DS1307 RTC chip with the I2C address of 0x51:

For Revision One boards use:

sudo su -

sudo echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-0/new_device

For Revision Two boards use:

sudo su -

sudo echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-1/new_device

To set the RTC Pi clock with the current system time:

hwclock --systohc

View the current date and time stored in the RTC Pi:

hwclock -r

Set the Linux system time to the value in the RTC Pi:

hwclock โ€“s

To set the Alarm Pi with a custom time:

hwclock --set --date="2012-12-25 06:00:12"  --utc

To create the Alarm Pi device creation at boot edit /etc/rc.local by running

sudo nano /etc/rc.local

and add:

echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-0/new_device (for v1 raspberry pi)
echo pcf8563 0x51 > /sys/class/i2c-adapter/i2c-1/new_device (v2 raspberry pi)
sudo hwclock -s (both versions)

before exit 0

Save your changes and then reboot the Raspberry Pi, the Alarm Pi board will then be detected when the Pi boots and set the time from the clock module.

Further instructions for using the PCF8563 Real Time Clock with C code samples are available on http://www.susa.net/wordpress/2012/06/raspberry-pi-pcf8563-real-time-clock-rtc/

alarmpi's People

Contributors

abelectronicsuk avatar argn avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.