Skip to content

Instantly share code, notes, and snippets.

View glynhudson's full-sized avatar

Glyn Hudson glynhudson

View GitHub Profile
@futureshape
futureshape / gist:1328159
Created October 31, 2011 17:54
Ethercard getNtpTime
unsigned long getNtpTime() {
unsigned long timeFromNTP;
const unsigned long seventy_years = 2208988800UL;
ether.ntpRequest(ntpServer, ntpMyPort);
Serial.println("NTP request sent");
while(true) {
word length = ether.packetReceive();
ether.packetLoop(length);
if(length > 0 && ether.ntpProcessAnswer(&timeFromNTP,ntpMyPort)) {
@glynhudson
glynhudson / nanode_pachube.pde
Created August 9, 2011 19:33 — forked from maniacbug/nanode_pachube.pde
Example to use EtherCard on Nanode to upload data to Pachube
// Simple demo for feeding some random data to Pachube.
// Based on pachube.pde 2011-07-08 <jcw@equi4.com> http://opensource.org/licenses/mit-license.php
// Created by <maniacbug@ymail.com>
// This has been tested with EtherCard rev 7752
// Get it from http://jeelabs.net/projects/11/wiki/EtherCard
#include <EtherCard.h>
// change these settings to match your own setup
#define FEED "33735"