Show Posts
Pages: 1 ... 8 9 [10] 11 12 13
136  Using Arduino / Programming Questions / SD Card and Ethernet lead to avrdude: stk500_recv(): programmer is not respondin on: March 29, 2012, 12:15:47 pm
Hi I combined the SD card ReadWrite sketch with one of my sketches and as soon as I add
 myFile ="test.txt", FILE_WRITE);
It breaks my sketch.
I get the error
avrdude: stk500_recv(): programmer is not responding
137  Using Arduino / Programming Questions / Re: SetSyncProvider using NTP on: March 29, 2012, 10:44:44 am
Thanks that sorted it along with some other modifications to the code
138  Using Arduino / Programming Questions / SetSyncProvider using NTP on: March 27, 2012, 09:27:09 am
Hi I am using the following code as part of a much larger sketch.  I would like to set the internal timer of the arduino.

 Udp NTP Client
 Get the time from a Network Time Protocol (NTP) time server
 Demonstrates use of UDP sendPacket and ReceivePacket
 For more on NTP time servers and the messages needed to communicate with them,
 created 4 Sep 2010
 by Michael Margolis
 modified 17 Sep 2010
 by Tom Igoe
 This code is in the public domain.


#include <SPI.h>         
#include <Ethernet.h>
#include <EthernetUdp.h>

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

unsigned int localPort = 8888;      // local port to listen for UDP packets

IPAddress timeServer(192, 43, 244, 18); // NTP server

const int NTP_PACKET_SIZE= 48; // NTP time stamp is in the first 48 bytes of the message

byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets

// A UDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

void setup()

  // start Ethernet and UDP
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:

void loop()
  sendNTPpacket(timeServer); // send an NTP packet to a time server

    // wait to see if a reply is available
  if ( Udp.parsePacket() ) { 
    // We've received a packet, read the data from it,NTP_PACKET_SIZE);  // read the packet into the buffer

    //the timestamp starts at byte 40 of the received packet and is four bytes,
    // or two words, long. First, esxtract the two words:

    unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
    unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); 
    // combine the four bytes (two words) into a long integer
    // this is NTP time (seconds since Jan 1 1900):
    unsigned long secsSince1900 = highWord << 16 | lowWord; 
    Serial.print("Seconds since Jan 1 1900 = " );

    // now convert NTP time into everyday time:
    Serial.print("Unix time = ");
    // Unix time starts on Jan 1 1970. In seconds, that's 2208988800:
    const unsigned long seventyYears = 2208988800UL;     
    // subtract seventy years:
    unsigned long epoch = secsSince1900 - seventyYears; 
    // print Unix time:

    // print the hour, minute and second:
    Serial.print("The UTC time is ");       // UTC is the time at Greenwich Meridian (GMT)
    Serial.print((epoch  % 86400L) / 3600); // print the hour (86400 equals secs per day)
    if ( ((epoch % 3600) / 60) < 10 ) {
      // In the first 10 minutes of each hour, we'll want a leading '0'
    Serial.print((epoch  % 3600) / 60); // print the minute (3600 equals secs per minute)
    if ( (epoch % 60) < 10 ) {
      // In the first 10 seconds of each minute, we'll want a leading '0'
    Serial.println(epoch %60); // print the second
  // wait ten seconds before asking for the time again

// send an NTP request to the time server at the given address
unsigned long sendNTPpacket(IPAddress& address)
  // set all bytes in the buffer to 0
  memset(packetBuffer, 0, NTP_PACKET_SIZE);
  // Initialize values needed to form NTP request
  // (see URL above for details on the packets)
  packetBuffer[0] = 0b11100011;   // LI, Version, Mode
  packetBuffer[1] = 0;     // Stratum, or type of clock
  packetBuffer[2] = 6;     // Polling Interval
  packetBuffer[3] = 0xEC;  // Peer Clock Precision
  // 8 bytes of zero for Root Delay & Root Dispersion
  packetBuffer[12]  = 49;
  packetBuffer[13]  = 0x4E;
  packetBuffer[14]  = 49;
  packetBuffer[15]  = 52;

  // all NTP fields have been given values, now
  // you can send a packet requesting a timestamp:    
  Udp.beginPacket(address, 123); //NTP requests are to port 123

I have tried all sorts of methods to map epoch into setsyncprovider and nothing seems to work.
Any ideas?
139  Using Arduino / Programming Questions / Re: SHT21 Soft i2c Libraries on: March 26, 2012, 07:57:48 am
Thanks got it working
140  Using Arduino / Displays / Re: E-Paper on: March 26, 2012, 07:09:15 am
the Kent displays are from a company called manhattan skyline (very nice people) and the pervasive ones are from densitron displays (nightmare to deal with)

141  Using Arduino / Programming Questions / Re: SHT21 Soft i2c Libraries on: March 26, 2012, 07:07:35 am
so what would I have to change?
My programming knowledge is very limited
142  Using Arduino / Programming Questions / Re: SHT21 Soft i2c Libraries on: March 26, 2012, 06:48:02 am
the one I saw which would be to change
virtual void write(byte);
virtual void write(byte, strlen(byte));
from what I understood did not work which is why i am asking
I then get the error
/Applications/Arduino error: 'strlen' is not a type
143  Using Arduino / Programming Questions / SHT21 Soft i2c Libraries on: March 26, 2012, 05:50:24 am
I am using the libraries in v1 of the IDE and am having problems with them.  They worked in the old version.

I get the error message

In file included from sketch_mar26a.cpp:1:
/Applications/Arduino error: conflicting return type specified for 'virtual void UartPlug::write(byte)'
/Applications/Arduino error:   overriding 'virtual size_t Print::write(uint8_t)'

the libraries and program are linked below

 - Program -
 - Ports.h -
 - Ports.cpp -
 - PortsSHT21.cpp -
 - Ports SHT21.h -
144  Using Arduino / Displays / Re: E-Paper on: March 23, 2012, 09:51:06 am
I am going to be using this for a project where i will be buying 50 so I am within the limits of small quantities.  I really wish sparkfun or adafruit would sell them with a breakout board (hint hint) to make development easier
145  Using Arduino / Displays / E-Paper on: March 17, 2012, 12:36:44 pm
I am working on a low power product that requires an epaper display.  I am deciding between the Kent choristic display or a pervasive displays epaper one
The pervasive displays one runs over SPI and works in a similar manner to a TFT
The kent has some pretty good libraries written for it already by Timm at
I was wondering if anyone has any experience with the displays and would using standard LCD libraries with little modification work for the Pervasive display?
146  Using Arduino / Storage / Re: SD Card on a 3.3V arduino on: March 01, 2012, 03:46:50 pm
Thanks that's perfect.
147  Using Arduino / Networking, Protocols, and Devices / Re: W5200 Module on: March 01, 2012, 03:43:18 pm
Yes they have written libraries for it that you just replace the W5100 files in the IDE
148  Using Arduino / Networking, Protocols, and Devices / Re: W5200 Module on: March 01, 2012, 11:50:19 am
Also what is the interrupt pin for?
149  Using Arduino / Networking, Protocols, and Devices / Re: W5200 Module on: March 01, 2012, 11:49:48 am
Yes it is a really nice little package.
150  Using Arduino / Storage / SD Card on a 3.3V arduino on: March 01, 2012, 10:07:32 am
i am designing a custom arduino PCB and I plan on using an ATmega328.  I am going to run the whole thing at 3.3V  Can I connect an SD card directly into the chip or do i still require extra components?  If so can someone please explain the pinout.  Thanks in advance.
Pages: 1 ... 8 9 [10] 11 12 13