Show Posts
Pages: 1 ... 115 116 [117] 118 119 ... 344
1741  Using Arduino / Project Guidance / Re: EasyVR + motor shield on Leonardo/Romeo on: June 12, 2013, 09:16:43 am
It would be very nice if you post links to the hardware you're using. I don't want to google around just to find some other hardware named similarily. And there are dozens of motor shields out in the wild...
1742  Using Arduino / Project Guidance / Re: Arduino uno with GSM sheild...SOAP web services on: June 12, 2013, 09:13:48 am
Change the programming on the server to use something simpler than SOAP. SOAP is quite blown up with stuff not needed in most situations and not suited for implementation on a microcontroller. Although you can program the Arduino to send some simple SOAP calls, it just wastes flash memory to store all the crap surrounding the essential information. Use SOAP on the bigger irons with GBs of memory but not on a processor with 2kB or RAM (many SOAP calls I see are bigger than this).
1743  Using Arduino / Networking, Protocols, and Devices / Re: Arduino Serial to Raspberry Pi on: June 12, 2013, 09:06:13 am
You could use any two pins on the Arduino, and SoftwareSerial, to send data to two pins on the PI.

Not really a good idea because the Raspberry Pi is running on 3V3 and the Arduino on 5V. The probability to damage the Pi is quite high.
1744  International / Deutsch / Re: Usb Port bricht ab, bei Arduino Mega 2560 on: June 12, 2013, 08:56:55 am
Sobald das externe Netzteil mehr als 6.6V liefert, wird es für die Stromversorgung des Arduinos verwendet. Wenn Du also den Rat von Uwe befolgst und ein Netzteil mit mindestens 7V nimmst, sollte es kein Problem sein.
1745  Using Arduino / Networking, Protocols, and Devices / Re: Algorithm for converting encoded octets into septets on: June 12, 2013, 08:14:28 am
This code should work on a 8-bit AVR platform (little-endian), but it's just a quick hack and untested.

int convert8to7(byte *input, byte *output, int inlength) {
  union {
    byte b[2];
    uint16_t u;
  int outlength = inlength * 8 / 7;
  for (int i = 0; i < outlength; i++) {
    int index = i * 7;
    int m = index % 8;
    index /= 8;
    b[0] = input[index];
    b[1] = index > 0 ? input[index - 1] : 0;
    output[i] = (u >> (8-m)) & 0x7F;
  return outlength;
1746  Using Arduino / Networking, Protocols, and Devices / Re: PMBus with Arduino on: June 12, 2013, 07:44:09 am
Try to change this line

byte n = Wire.requestFrom(addr, 8);


byte n = Wire.requestFrom(addr, 8, (uint8_t) false);

to keep the Wire library from sending the stop condition but to send a repeated start condition.
1747  Using Arduino / Networking, Protocols, and Devices / Re: Issues communicating with Parallax OFN over I2C on: June 12, 2013, 05:11:16 am
According to the sample code in the datasheet (top of page 4), the I2C device address is 0x33. Try with this address and report if you have success.
1748  Using Arduino / Networking, Protocols, and Devices / Re: Hlaf-duplex - what am I doing wrong? on: June 12, 2013, 05:02:35 am
Try inserting the line


before this line:

      digitalWrite(rs485XmitPin, HIGH);

It's in the example code of Nick Gammon too and gives the master time to prepare for receiving.

But I don't see the reason for the delayMicroseconds(500) in your code.
1749  Using Arduino / Networking, Protocols, and Devices / Re: Odd behavior with Ethercard library on: June 12, 2013, 04:45:27 am
Do you use a bootloader and if yes, which one?

Were you able to measure how long D10 stays high before your code in setup sets it to low (this may give us a hint where to look for in the code)?

Probably the offending code is here:

void ENC28J60::initSPI () {
    pinMode(SS, OUTPUT);
    digitalWrite(SS, HIGH);
    pinMode(MOSI, OUTPUT);
    pinMode(SCK, OUTPUT);  
    pinMode(MISO, INPUT);
    digitalWrite(MOSI, HIGH);
    digitalWrite(MOSI, LOW);
    digitalWrite(SCK, LOW);

    SPCR = bit(SPE) | bit(MSTR); // 8 MHz @ 16
    bitSet(SPSR, SPI2X);

You can comment out the digitalWrite(SS, HIGH), without any problems and you may have solved your issue.
1750  Using Arduino / Networking, Protocols, and Devices / Re: Transmitting an integer over I2C on: June 12, 2013, 03:26:29 am
You made several errors in your sketch. The first is that a variable of type "int" is 15 bits in size plus one sign bit. I recommend that you use the explicit types (int16_t, uint32_t, etc.) so you always get the correct size.

In your case you don't need 32 bit because the result of an analogRead() call is a 10 bit integer.

The next error is in your main loop():

  Wire.requestFrom(1, 1);   // the first byte
    char received =;
    output = received;
  for (int i = 0 ; i < 3 ; i++) // next 3 bytes
     Wire.requestFrom(1, 1);   
        char received =;
        output |= (received << 8);

The code "received << 8" always produces a result of zero because received is of type char and a char has only 8 bits. You move all 8 bits out of the variable so only 0 is left. If you're very lucky, the compiler noticed your mistake and switched to a 16 bit value for the result but even then you're or'ing 3 bytes to the same result byte probably producing very unexpected outputs.

So switch to unsigned 16 bit integers for your sketch and use unions like this:

union {
  uint16_t    intval;
  uint8_t     bytes[2];

This way you can fill in the bytes and read out the unsigned integer value.
1751  Using Arduino / Networking, Protocols, and Devices / Re: 2 telnet Clients on one Arduino Ethernet on: June 12, 2013, 03:12:24 am
Yes, what's the output of the serial interface while you're running the sketch?
1752  International / Deutsch / Re: Cocktailmixer on: June 11, 2013, 12:43:44 pm
Beim UNO hast Du 20 digitale Ein-/Ausgänge, wovon Du 6 auch als analoge Eingänge nutzen kannst.
1753  Using Arduino / Project Guidance / Re: Battery Backup Question. on: June 11, 2013, 11:49:10 am
isn't there is delay when the main power supply is transferred to the ups(the fluctuation of voltage).

I don't hope so because if it is, the power to the Arduino would  be interrupted and the microcontroller reset.

can i connect 5v directly to the interrupt pin of arduino uno?

Yes you can but you probably won't see any edge there.
1754  Using Arduino / Programming Questions / Re: how to access a phone number record in the SIM memory by means of ARDUINO? on: June 11, 2013, 11:32:40 am
According to the manual for the used GSM device (Telit GE865: the necessary commands include AT+CPBS (for selecting the SIM phonebook), AT+CPBF (for finding the named entry) and maybe AT+CPBR (to get an indexed entry in the phonebook).
1755  Using Arduino / Networking, Protocols, and Devices / Re: ethernet + sd + login HELP! on: June 11, 2013, 11:16:28 am
how can i connect arduino to the site on

I don't know anything about your network setup. If you don't want to or are not able to change the network parameters (changing the NAT router to forward a port to the Arduino), you have to program the Arduino as a client which sends it's data as often as necessary for your application (you still didn't provide a description of what you want to achieve) to the web server and gets commands back as the response (polling). The WebClientRepeating example of the Ethernet library gives you hints then about how you're able to program that.
Otherwise the WebServer example of the Ethernet library is the point to start.
Pages: 1 ... 115 116 [117] 118 119 ... 344