Show Posts
Pages: [1] 2
1  Using Arduino / Programming Questions / Alert: Note about using Arduino 1.0 Ethernet DCHP on: December 01, 2011, 02:35:47 am
Hi, after downloading Arduino 1.0, my first test of the new features was the Ethernet libraries DHCP capability. I shorty discovered one minor bug with my setup. If you have a microSD card in the slot on the Ethernet Shield and call
Code:
Ethernet.begin(mac);
like in the examples, it won't connect. This is due to the fact that in older verisons of Arduino (like 0022), when you wanted to use the SD slot, but not the Ethernet, you had to disable the Wiznet chip and then you could use the SD card. In the newest version of Arduino, you must disable the SD card (presuming the sketch is starting with one in it), then call
Code:
Ethernet.begin(mac);
To disable the SD card, call
Code:
pinMode(4, OUTPUT);
and then
Code:
digitalWrite(4, HIGH);
and this will disable the SD card.
2  Using Arduino / Programming Questions / Re: How to set time on: November 24, 2011, 05:41:25 am
The problem is that you aren't reseting sensor_time back to 0 when sensor_value is above the threshold.

Here is the modified code, there is a boolean recording if the led has been triggered.

Quote
#define THRESHOLD 100 // the threshold value
#define SENSOR_TIME 10000 // the amount of time (in milliseconds) that the sensor value has to stay below the threshold (or hold value)
int ledPin = 10; // The digital pin the LED is on
boolean triggered = false; // The "state" of the LED
unsigned long sensor_time; // The last millisecond that the sensor transitioned from being above the threshold and being below it (or the sensor's time stamp)
int sensorPin = 0; // The analog pin the sensor is on
void setup() { // Setup function
  pinMode(ledPin, OUTPUT); // Set the pin mode of the LED pin to output
  Serial.begin(9600); // Initialize the Serial port to a baud rate of 9600bps
}
void loop() { // Loop function
  int sensorValue = analogRead(sensorPin); // Read the value of the sensor
  Serial.println(sensorValue); // Print to the Serial port the value of the sensor
  if (sensorValue < THRESHOLD){ // If the value of the sensor is above the threshold value
    if (sensor_time == 0) { // If the sensor's time stamp hasn't been updated already
      sensor_time = millis(); // store the current millisecond into memory
    }
    else if (millis() - sensor_time > SENSOR_TIME){ // If the sensor's time stamp subtracted from the current millisecond is greater than the hold value
      digitalWrite(ledPin, HIGH); // Set the LED pin high (change to LOW for active low LEDs)
      triggered = true; // Record that the LED has been triggered
    }
  }
  else {
    digitalWrite(ledPin, LOW); // Set the LED pin low (change to HIGH for active low LEDs)
    if(triggered) { // If the LED has already been triggered
      sensor_time = 0; // Reset the sensor's time stamp to 0
      triggered = false; // Reset the state of the LEDs triggered value
    }
    else {
      // Do nothing
    }
  }
}


I can make a small library if you want to make this process easier to do.
3  General Category / General Discussion / Re: Arduino 1.0 Soon - What do you want to see? on: September 17, 2011, 12:35:56 am
the ability to scroll down and up on the sketchbook list and libraries list.

I think it would be cool to have the same tech as the Intellisense feature of eclipse and visual studio.
4  Using Arduino / Networking, Protocols, and Devices / Re: Can I make a Wifi router with Arduino ? on: June 17, 2011, 01:02:43 am
to have severial wireless devices wotk together, if using internet connections like wifi and ethernet, all you have to do is use seperate ports like Arduino A to Computer B uses port 8080, and Arduino A to Computer C uses port 9080, where port is like a socket (i.e. - http is port 80 and telnet is port 21), I could write a quick example for using one ethernet shield two computers with custom software and using handshaking, you know, if you want one...
5  Using Arduino / Programming Questions / Re: help with : shiftregister + fading on: June 10, 2011, 09:13:29 pm
I wouldn't know what code to use, but couldn't you pulse the demulitplexer's output led value on and off really fast to get the led to seem like it's fading in and out using different delays and then use that method to "fade" the other leds?
6  Using Arduino / Project Guidance / Re: Using the Ethernet Shield and an LCD on: May 22, 2011, 11:06:38 pm
I got messages to appear on the lcd from an internet request, but I now need help creating the user interface html pages to make it easier for someone to send a message than typing it all out in the url bar.
7  Using Arduino / Project Guidance / Using the Ethernet Shield and an LCD on: May 22, 2011, 04:54:26 am
Hi, I'm trying to get my arduino setup so that when someone types in a url on a pc, it is connected to the arduino and displays the "message" sent to the arduino. I am using the TinyWebServer and the EthernetDHCP libraries. I have the server running smoothly, and I am able to display text on the lcd correctly, but getting a message to the lcd from the internet is what I'm having trouble with. Any help would be appreciated!
8  Using Arduino / Project Guidance / Re: Ethernet Shield help on: May 09, 2011, 09:57:21 pm
I tried the TinyWebServer and it works the way I wanted it to.
9  Using Arduino / Project Guidance / Re: Ethernet Shield help on: May 08, 2011, 11:39:17 pm
No, I am not using the TinyWebServer, I don't really want to due to the fact that I am using the EthernetDHCP library instead of the deafault library due to not getting results with the static IP address. I am using the newest official ethernet shield. I have also found that with certain variations on my code, it would sometimes internally reset itself. I accidentally got rid of my code that was giving me issues, so I can't really post that now...
10  Using Arduino / Project Guidance / Ethernet Shield help on: May 08, 2011, 08:54:57 pm
Hi, I am trying to use my arduino with an ethernet shield to act as a webserver, I have it opening a file from the sd card slot, which works, but then I can't get the ethernet port to work, so that I can see if it loaded the text file properly. I have the program disable the wiznet chip, so that it can read from the sd card, but then I can't get the wiznet chip re enable, how do I do this properly. I can post my code if nessesary.
11  Development / Other Hardware Development / PS/2 shield on: February 08, 2011, 10:18:09 pm
a couple of days ago, I got a key-counter from sparkfun, but since the only true way I could truly use it is to use the icsp header, and reprogram it. I don't have a icsp programer, so I opted for desoldering the ps2 ports. I have made a two-port ps2 shield that just has a ps2 port hooked up w/ clk on digital io pin 2, data on digital io pin 15 (analog 1). The second port's clk is on digital io pin 3, w/ data on digital io pin 14 (analog 0). It does have some problems, such as when using two keyboards, it doesn't read the one on 2 & 15, and the one on 3 & 14 reads some keypresses as keyboard 1 and some as keyboard 2, but that may be a software issue.
12  Forum 2005-2010 (read only) / Troubleshooting / Re: Voltage Drop with Ethernet Shield on: November 25, 2010, 02:49:09 am
why not use transistors to activate the relays, that way you can use less voltage from the io pins. connect the 5V pins to the collectors of the transistors, the io pins to the base of the transistors, and the relay coil in contacts to the emitters of the transistors and if you use NPN transistors, you set the io pin to high, and voltage flows through the transistor, set the pin low, and voltage stops. likewise, if you use a PNP transistor, it's opposite, setting the pin low allows voltage though, and visa versa.
13  Forum 2005-2010 (read only) / Troubleshooting / Re: My program won't upload on: July 21, 2010, 07:56:15 pm
well, as I said earlier in this topic, I just decided to get an arduino duemilnove, because i fried the atmega chip in the arduino mega by accident - i connected a 12v power supply to the ac plug, and whilst trying to get more power to a motor, i connected the 5v and vin pins together. i kind of wish that i had a high-power diode then. but since i fried the chip in the mega, i am sooo going to be more careful.  smiley-wink
14  Forum 2005-2010 (read only) / Troubleshooting / Re: My program won't upload on: July 19, 2010, 08:54:56 pm
@Mr.A

If I had known to reinstall the FTDI drivers, I might have an Arduino Mega, and an Arudino Duemilanove.  ;D
15  Forum 2005-2010 (read only) / Troubleshooting / Re: My program won't upload on: July 19, 2010, 08:52:07 pm
this topic is no longer valid by the creator of this topic (me).
It still can be used for the same general purpose if need be.
Pages: [1] 2