Show Posts
Pages: 1 [2]
16  Forum 2005-2010 (read only) / Interfacing / Re: Ethernet shield - webClient example on: February 11, 2010, 04:44:00 pm
Thank you for the suggestions, but those addresses gave me the same result. Should I be trying other (less frequently rearranged) sites? Should I try playing with wireshark? Thanks!
17  Forum 2005-2010 (read only) / Interfacing / Re: Ethernet shield - webClient example on: February 10, 2010, 01:59:38 am
Hi everyone, I'm hoping someone can help me figure out how to get WebClient to run. I'm a relative network noob but I've read through all the threads I can find on this.

My setup:
1. OS X 10.5.8, computer is internet sharing my airport connection.
2. WebServer sketch seems to work fine using ip of 192.168.2.3.
3. Ping to 192.168.2.3 seems to work fine.
4. Yet WebClient connection fails after about 1 minute of "connecting..." I'm using the standard WebClient sketch with the following declarations:
Code:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 3 };
byte subnet[] = { 255, 255, 0, 0 };
byte gateway[] = { 192, 168, 2, 1 };
byte server[] = { 64, 233, 187, 99 }; // Google
FYI, ifconfig en0 produced:
Quote
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
      inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
      inet6 fe80::21f:5bff:fef3:7a1f%en0 prefixlen 64 scopeid 0x4
      inet 169.254.25.48 netmask 0xffff0000 broadcast 169.254.255.255
      ether 00:1f:5b:f3:7a:1f
      media: autoselect (100baseTX <full-duplex>) status: active...

Any suggestions? Many thanks!
18  Forum 2005-2010 (read only) / Exhibition / Re: Change Led Fade Speed With Potentiometer on: April 29, 2010, 12:16:43 pm
For smoother fading you could make the potentiometer control the delay time while keeping the increment at 1 unit. N.B., I've reversed the map function so that this should (i think) work just like your version:

Code:
{
  val = analogRead(potPin);
  val = map(val, 0, 1023, 5, 1);
}
  delay(500);
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=1) {
  analogWrite(ledPin, fadeValue);        
  delay(val);    
  }
  delay(500);
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=1) {
  analogWrite(ledPin, fadeValue);
  delay(val);                            
  }
19  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: How do I make one key piano keyboard? on: April 28, 2010, 12:42:47 pm
Adafruit wave shield
http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=94

Adafruit wave shield with SD card and speaker
http://www.adafruit.com/index.php?main_page=product_info&cPath=17_21&products_id=175

The wave shield would let you play back a 22KHz 16bit mono *.wav file. Of what I've seen so far, that's the easiest way to get playback of a recognizable "piano" note. There are some interesting arduino projects out there that make "synth" sounds but getting a good piano sound with arduino alone would take a great deal of cleverness.
20  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: i don't want delay on: July 13, 2010, 07:51:06 pm
Like retrolefty was saying, the "Blink without delay" code is a generic example of a timed action executed without using "delay" (as your code does), but instead by having the arduino check for elapsed time each time it loops through the code in "loop()".

You code already makes the switches turn on their respective motors whenever the input pins are triggered. You could adjust your code so that instead of triggering the motors directly, the inputs reset a counter:
Code:
if (mot1State == HIGH) {    
   // Assign new trigger1Time
   trigger1Time = millis();
}
Then you could have the arduino check to see if the elapsed time since that trigger is more or less than 20 seconds (20000 ms).
Code:
if (millis - trigger1Time < 20000) {....
If less, the motor should be turned on. If more, the motor should be turned off. That way, the arduino will monitor the inputs continuously, and keep the motors on for 20 seconds after the end of the last input trigger.
21  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Practical uses of Capacitors in Arduino projects? on: July 12, 2010, 07:07:37 pm
Graynomad and tehjrow suggested two common uses for capacitors in Arduino projects:

1) electronically debounce a switch (as opposed to doing it in software like here: http://www.arduino.cc/en/Tutorial/Debounce

2) generate analog voltages using analogWrite(). You may have read that Arduino's "analog" output is really PWM, consisting of a timed mix of 100% and 0% voltages, with nothing in between. That's find for LEDs and hobby motors, but sometimes that won't work. For instance, if you wanted to play a nice smooth sine wave tone through a speaker, you'd need one or more capacitors to convert the square wave from the Arduino into a sine wave for the speaker. See here for more: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1268237950/12
22  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Webcam on: April 27, 2010, 03:41:13 pm
Much easier to use the arduino as the trigger for a cheap digital camera, rather than the processor for it. Many great examples on the interwebs.

http://hackaday.com/2009/06/19/arduino-camera-laser-trigger/
http://www.instructables.com/id/Hacking-A-Keychain-Digital-Camera-for-Arduino-Cont/
http://www.bratpack.org.uk/tag/arduino/
http://www.glacialwanderer.com/hobbyrobotics/?p=167

Good luck!
23  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Question about power/PWM on: April 20, 2010, 04:57:48 pm
Quote
I guess the question then becomes if the transistor would accept the same sort of signal as I am currently passing straight into the LED. That is, currently I am passing values between 0 and 255 for the R, G, and B pins on the LED. I presume a transistor could handle varying inputs the same way through PWM (ie. would not simply be on or off)?

http://www.arduino.cc/en/Tutorial/PWM
Quote
Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.
Pages: 1 [2]