Show Posts
Pages: 1 ... 8 9 [10] 11 12 13
136  Using Arduino / Programming Questions / Re: SD Card and Ethernet lead to avrdude: stk500_recv(): programmer is not respondin on: March 29, 2012, 04:37:15 pm
Oh that would make sense.

Here is my code, I would take a guess that it is probably not very efficient
137  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
Code:
 myFile = SD.open("test.txt", FILE_WRITE);
It breaks my sketch.
I get the error
Quote
avrdude: stk500_recv(): programmer is not responding
138  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
139  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.
Code:
/*

 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,
 see http://en.wikipedia.org/wiki/Network_Time_Protocol
 
 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); // time.nist.gov 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()
{
  Serial.begin(9600);

  // 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:
    for(;;)
      ;
  }
  Udp.begin(localPort);
}

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

    // wait to see if a reply is available
  delay(1000); 
  if ( Udp.parsePacket() ) { 
    // We've received a packet, read the data from it
    Udp.read(packetBuffer,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 = " );
    Serial.println(secsSince1900);               

    // 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:
    Serial.println(epoch);                               


    // 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)
    Serial.print(':'); 
    if ( ((epoch % 3600) / 60) < 10 ) {
      // In the first 10 minutes of each hour, we'll want a leading '0'
      Serial.print('0');
    }
    Serial.print((epoch  % 3600) / 60); // print the minute (3600 equals secs per minute)
    Serial.print(':');
    if ( (epoch % 60) < 10 ) {
      // In the first 10 seconds of each minute, we'll want a leading '0'
      Serial.print('0');
    }
    Serial.println(epoch %60); // print the second
  }
  // wait ten seconds before asking for the time again
  delay(10000);
}

// 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
  Udp.write(packetBuffer,NTP_PACKET_SIZE);
  Udp.endPacket();
}

I have tried all sorts of methods to map epoch into setsyncprovider and nothing seems to work.
Any ideas?
140  Using Arduino / Programming Questions / Re: SHT21 Soft i2c Libraries on: March 26, 2012, 07:57:48 am
Thanks got it working
141  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)
http://www.mansky.co.uk/
http://www.densitron.com/

142  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
143  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
Code:
virtual void write(byte);
to
Code:
virtual void write(byte, strlen(byte));
from what I understood did not work which is why i am asking
I then get the error
Quote
/Applications/Arduino v1.0.app/Contents/Resources/Java/libraries/Ports/Ports.h:239: error: 'strlen' is not a type
144  Using Arduino / Programming Questions / SHT21 Soft i2c Libraries on: March 26, 2012, 05:50:24 am
Hi
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
Quote

In file included from sketch_mar26a.cpp:1:
/Applications/Arduino v1.0.app/Contents/Resources/Java/libraries/Ports/Ports.h:239: error: conflicting return type specified for 'virtual void UartPlug::write(byte)'
/Applications/Arduino v1.0.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'

the libraries and program are linked below

 - Program - http://pastebin.com/ZkDX8EjD
 - Ports.h - http://pastebin.com/0C914put
 - Ports.cpp - http://pastebin.com/jEbiyNUd
 - PortsSHT21.cpp - http://pastebin.com/a9nrTwsB
 - Ports SHT21.h - http://pastebin.com/S4kW7002
145  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
146  Using Arduino / Displays / E-Paper on: March 17, 2012, 12:36:44 pm
Hi
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
http://www.filedropper.com/eg020as01420inch
The kent has some pretty good libraries written for it already by Timm at http://tim.cexx.org/
http://www.filedropper.com/25138b128x32cog
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?
147  Using Arduino / Storage / Re: SD Card on a 3.3V arduino on: March 01, 2012, 03:46:50 pm
Hey
Thanks that's perfect.
148  Using Arduino / Networking, Protocols, and Devices / Re: W5200 Module on: March 01, 2012, 03:43:18 pm
Hey
Yes they have written libraries for it that you just replace the W5100 files in the IDE
http://www.wiznet.co.kr/Sub_Modules/en/product/Product_Detail.asp?cate1=5&cate2=42&cate3=0&pid=1161#tab
149  Using Arduino / Networking, Protocols, and Devices / Re: W5200 Module on: March 01, 2012, 11:50:19 am
Also what is the interrupt pin for?
150  Using Arduino / Networking, Protocols, and Devices / Re: W5200 Module on: March 01, 2012, 11:49:48 am
Hey
thanks.
Yes it is a really nice little package.
Pages: 1 ... 8 9 [10] 11 12 13