Show Posts
Pages: [1] 2 3 ... 581
1  Using Arduino / Project Guidance / Re: Which LilyPad to use - noob on: July 28, 2014, 08:16:49 pm
The LilyPad Arduino USB has 9 pins.  Five can be used for PWM output and the other four can be used for analog inputs.

It has no connections for the hardware serial port so you need two data pins for SoftwareSerial to talk to your Bluetooth Mate.

That leaves you with 7 pins for buttons and LEDs.  If you need more buttons or LEDs there are many techniques for expanding the capability of an Arduino.  Three data pins connected to a shift register will give you eight outputs for more LEDs.  Multiple buttons can connect to a single analog input as long as only one is pressed at a time.

So the part about "imitate a pointing device"  is no longer part of the requirements?
2  Using Arduino / Programming Questions / Re: Trouble Controlling Servo with Toggle Switch on: July 28, 2014, 03:36:37 pm
Your sketch is too complicated.  Try this:
Code:
#include <Servo.h>
const int switchPin = 4; //active low
const int servoPin = 9;
Servo servo;

void setup() {
  pinMode(switchPin, INPUT_PULLUP);
  servo.attach(servoPin);
}

void loop() {
  if (digitalRead(switchPin))
    servo.write(90);  // HIGH (switch is off)
  else
    servo.write(100);  // LOW (switch is on)

  delay(500);  //delay for debounce
}
3  Using Arduino / Project Guidance / Re: Question about ultrasonic sensor on: July 28, 2014, 03:28:09 pm
If you unplug the USB cable, how are you providing power?
4  Using Arduino / Motors, Mechanics, and Power / Re: MOSFETs for PWM of high current/voltage - Does order in series matter? on: July 28, 2014, 03:24:58 pm
Is there any particular reason why I never see the MOSFET between the cathode of the LED and Vin?

I think you mean "between Vin and the ANODE of the LED".  Cathode is the negative side: ground.

Yes.  It is easy to use a logic-level N-Channel MOSFET as a low-side switch.  Put it between the load and Ground and connect the data pin to Gate through a current limiting resistor.

To use a MOSFET as a high-side switch you need a P-Channel MOSFET and you need to raise the gate to Vin to get it to turn off.  You can do that with a pull-up on the gate and an NPN transistor to drag it to Ground when you want to turn it on but that's two more components.
5  Using Arduino / Project Guidance / Re: Which LilyPad to use - noob on: July 28, 2014, 03:17:21 pm
The Bluetooth Mate Gold or Silver will only do serial I/O.  You can't connect them to the USB connector on a LilyPad Arduino USB and use that as a pointing device.

I would connect an Arduino Leonardo (or other USB-capable Arduino) to the PC and use a simple one-way radio to send motion information from the wearable to the Leonardo.  For the wearable, almost any small Arduino or clone will do, like a Mini or Nano.
6  Using Arduino / Sensors / Re: Reading multiple sensors on: July 28, 2014, 01:01:15 pm
I say again:

Run your program and cut and paste the output you see in the Serial Monitor window.  Then show your current sketch if it has changed any.  Point out the places in your output where you expected to see something and don't see it.
7  Using Arduino / Sensors / Re: Reading multiple sensors on: July 28, 2014, 11:10:41 am
In your first message you say: ".i cant read light sensor values. ".  In a recent reply you say " I cant see temperature ."

Run your program and cut and paste the output you see in the Serial Monitor window.  Then show your current sketch if it has changed any.  Point out the places in your output where you expected to see something and don't see it.
8  Using Arduino / Programming Questions / Re: Measure square wave frequency on: July 28, 2014, 10:58:36 am
The problem is that it can measure 1.5kHz accurately but I need to measure even lower frequency.

What lower frequency are you trying to measure and is what way is the current sketch giving the wrong answer?
9  Using Arduino / Project Guidance / Re: airsoft prop feasability on: July 28, 2014, 08:44:33 am
You can't put a 'shield' on a Nano so use a breakout board for the MP3 player like this: http://www.adafruit.com/products/1381  That uses 8 pins but gives you 8 GPIO pins you can use for the keypad.  A 3x4 keypad uses 7 pins. 

An I2C LCD uses 2 pins.  A plain LCD uses 6 pins.

So that's 10-14 pins on an Arduino that has about 20.  Pin count should not be a problem.
10  Using Arduino / Installation & Troubleshooting / Re: Loop back test passed. What else could be wrong? on: July 28, 2014, 08:27:32 am
If your old sketch is flooding the USB output the solution is to:

Press and hold the RESET button on the Arduino UNO.
Unplug the USB cable for several seconds.
Re-plug the USB cable.
Click on the upload button for the new sketch.
Wait for the "Binary sketch size:" message.
Release the RESET button.
11  Community / Gigs and Collaborations / Re: Quick $5 for the first working response on: July 28, 2014, 06:41:16 am
Just move the close bracket as in this line of John's code.
Code:
  int destination = map(analogRead(A0), 0,1023, 10, 180);

Oops.  sorry for the typo.  Now fixed in the original post.
12  Using Arduino / Project Guidance / Re: Novation Launchpad Arduino Clone on: July 27, 2014, 01:10:57 pm
The 4051 is a multiplexer, not a shift register.  It's fine for expanding inputs (digital or analog) but it can only control one output at a time.  The 74HC595 shift register is good for outputs.  The 74HC165 is good for digital inputs.
13  Using Arduino / Sensors / Re: Reading multiple sensors on: July 27, 2014, 12:38:28 pm
The only different part of the code is here:
Code:
  if ( sensorValue > 200 )
  {
    Serial.println("darkside");
    delay(1000);
  }

Maybe your threshold is set too high?  Have you tried displaying the value to see if you reach 200?

I would try something other than arbitrary delays to keep the output rate down.  Perhaps only display output when something changes.
14  Using Arduino / Sensors / Re: Reading multiple sensors on: July 27, 2014, 11:03:09 am
You are calibrating the MAX and MIN of your light sensor in the first five seconds after power-up.  Are you sure you are rotating the device so it can get valid MAX and MIN values?  Could your LDR have gotten disconnected?
15  Using Arduino / Networking, Protocols, and Devices / Re: Manually setting UDP address with Shields on: July 27, 2014, 10:52:28 am
Those functions are for getting header data from a received UDP packet:

http://arduino.cc/en/Reference/WiFiUDPRemoteIP

To specify an arbitrary destination use the domain name ("server.demo.com") or the IP address:

Code:
       IPAddress destination(192, 168, 0, 2);
       Udp.beginPacket(destination, 3030);

The port number is just an integer.
Pages: [1] 2 3 ... 581