Show Posts
Pages: 1 ... 115 116 [117] 118 119 ... 343
1741  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:

Code:
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.
1742  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():

Code:
  Wire.requestFrom(1, 1);   // the first byte
  while(Wire.available())
  {
    char received = Wire.read();
    output = received;
  }
 
  for (int i = 0 ; i < 3 ; i++) // next 3 bytes
  {
     Wire.requestFrom(1, 1);   
     while(Wire.available())
     {
        char received = Wire.read();
        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:

Code:
union {
  uint16_t    intval;
  uint8_t     bytes[2];
};

This way you can fill in the bytes and read out the unsigned integer value.
1743  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?
1744  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.
1745  Using Arduino / Project Guidance / Re: Battery Backup Question. on: June 11, 2013, 11:49:10 am
Quote
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.

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

Yes you can but you probably won't see any edge there.
1746  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: http://www.telit.com/module/infopool/download.php?id=542) 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).
1747  Using Arduino / Networking, Protocols, and Devices / Re: ethernet + sd + login HELP! on: June 11, 2013, 11:16:28 am
Quote
how can i connect arduino to the site on valerioarduino.altervista.org?

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.
1748  Using Arduino / Sensors / Re: Temperature sensor advice / recommendation, please on: June 11, 2013, 11:06:38 am
I'd recommend DS18B20 OneWire temperature sensors. They have a measuring range up to 125°C, are quite accurate and easy to wire and program.
1749  Using Arduino / Project Guidance / Re: mq 7 sensor on: June 11, 2013, 10:57:49 am
Quote

Then you don't need to use PWM for the 1.4V but you just toggle between the two provided voltages on the board with the TOGG pin.

Quote
How to convert analog reading into parts per million ?

Have you seen the graph on the page linked above? You don't even get a linear value at a given concentration, so you have to average the reading over the 60s you're heating at 5V and without calibration you just get relative values not absolute ones.
1750  Using Arduino / Project Guidance / Re: arduino micro as HID without driver installation on new computers on: June 11, 2013, 10:41:02 am
Although you don't describe your problem in detail I guess it has to do with the serial device emulation on the USB that gets installed to enable sketch uploading. So you have to ensure that the serial device information (CDC) don't get included and that you upload your sketch with a programmer to overwrite the bootloader.

Post your current sketch.
1751  Using Arduino / Project Guidance / Re: Battery Backup Question. on: June 11, 2013, 10:20:11 am
Take a look at Seeeduino Stalker, there you have the necessary electronics and an Arduino on one board:

http://www.seeedstudio.com/wiki/Seeeduino_Stalker
1752  Using Arduino / Project Guidance / Re: Help required in washing machine project on: June 11, 2013, 10:16:11 am
Buy a commercial washing machine (you get them cheap on ebay) and replace just the electronics with your Arduino if you want more features. If you do the mechanics yourself the slightest unbalance may injure you seriously.

BTW: this is not a beginners project. Start with some easy sketches and drive LEDs and such stuff. You should have an education or experience with electric stuff before using high voltage applications.
1753  Using Arduino / Networking, Protocols, and Devices / Re: ethernet + sd + login HELP! on: June 11, 2013, 10:11:32 am
I'd suggest that you do your login stuff on the hosted web server and let the PHP scripts there access the Arduino if necessary. Do a minimal webserver sketch on the Arduino (without SD card usage) that just returns the status of whatever pin you like and accepts commands for the outputs you have to do. Then make a simple check in the sketch if the requesting IP is the IP of your webserver. This way the security is up to the scripts on the hosted server (although PHP and security excludes each other IMHO) and you can keep the sketch on the Arduino simple and reliable.
1754  Using Arduino / Networking, Protocols, and Devices / Re: 2 telnet Clients on one Arduino Ethernet on: June 11, 2013, 10:04:41 am
What's the output of your sketch?
1755  Using Arduino / Networking, Protocols, and Devices / Re: ethernet + sd + login HELP! on: June 11, 2013, 09:52:37 am
There are at least a thousand projects on the Web about using an Arduino with an Ethernet Shield to drive some pins by a web server. You still haven't provided any useful description of what you want to achieve, so that's the only advice I can give you: use Google to find these projects.
Pages: 1 ... 115 116 [117] 118 119 ... 343