Show Posts
Pages: 1 [2] 3 4 ... 41
16  Using Arduino / Programming Questions / Re: Encoder + Motor Not working on: February 13, 2014, 06:14:19 pm
Ok I ran several tests with two different Arduino Mega boards , and several encoders. I used the exact code that comes with the library and powered my motors separately. I also changed the ports to interrupt pins during some trials. Still no luck. I'm convinced that this is a software issue. I know that some older libraries need to be modified to work with the new Arduino software is the encoder library one of them?  Is there any reason the the Mega might not work?  Thanks for any help!

http://www.pjrc.com/teensy/td_libs_Encoder.html

Code:
/* Encoder Library - Basic Example
 * http://www.pjrc.com/teensy/td_libs_Encoder.html
 *
 * This example code is in the public domain.
 */

#include <Encoder.h>

// Change these two numbers to the pins connected to your encoder.
//   Best Performance: both pins have interrupt capability
//   Good Performance: only the first pin has interrupt capability
//   Low Performance:  neither pin has interrupt capability
Encoder myEnc(5, 6);
//   avoid using pins with LEDs attached

void setup() {
  Serial.begin(9600);
  Serial.println("Basic Encoder Test:");
}

long oldPosition  = -999;

void loop() {
  long newPosition = myEnc.read();
  if (newPosition != oldPosition) {
    oldPosition = newPosition;
    Serial.println(newPosition);
  }
}
17  Using Arduino / Programming Questions / Encoder + Motor Not working on: February 12, 2014, 10:06:05 pm
Hello,

I have altered some example code from the encoder library yet it is not working. I'm justing trying to get some feedback from my motor encoder. Everything is hooked up correctly and the motors are moving, however, I never getting anything back on serial monitor except 0. Is there anything that is obviously wrong with my code? The only thing I can think of is that the two libraries are conflicting with each other.


Thanks!

Code:
/* Encoder Library - Basic Example
 * http://www.pjrc.com/teensy/td_libs_Encoder.html
 *
 * This example code is in the public domain.
 */

#include <Encoder.h>
#include <Servo.h>
Servo servo1;  // not a servo... it is a motor driver
Servo servo2; // not a servo... it is a motor driver  (not need, I just put it here encase I had the encoder on the wrong motor)

// Change these two numbers to the pins connected to your encoder.
//   Best Performance: both pins have interrupt capability
//   Good Performance: only the first pin has interrupt capability
//   Low Performance:  neither pin has interrupt capability
Encoder myEnc(23, 19);
//   avoid using pins with LEDs attached

void setup() {
  Serial.begin(9600);
  Serial.println("Basic Encoder Test:");
   servo1.attach(8);  // not a servo... it is a motor driver
  servo2.attach(9);   // not a servo... it is a motor driver  (not need, I just put it here encase I had the encoder on the wrong motor)
}

long oldPosition  = -999;

void loop() {
  
 servo1.writeMicroseconds(1900);  // make motor 1 move
servo2.writeMicroseconds(1900);  // make motor 2 move (not need, I just put it here encase I had the encoder on the wrong motor)

  long newPosition = myEnc.read();
  if (newPosition != oldPosition) {
    oldPosition = newPosition;
    Serial.println(newPosition);
  }
}


Thanks!
18  Using Arduino / Motors, Mechanics, and Power / Re: Outdoor Battery / Power Source on: February 12, 2014, 04:00:39 pm
Your going to need a bigger power source if you want your weather station to run for a useful amount of time.  Try something like this...
 http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx
19  Using Arduino / General Electronics / Re: Arduino Mega current supply??? on: February 12, 2014, 03:55:37 pm
Ok. Thanks.
20  Using Arduino / General Electronics / Re: Component requires 24v on: February 11, 2014, 03:33:44 pm
Thanks for the specs. Here is what I would get...

http://www.ebay.com/itm/US-DC-24V-500mA-1A-Switching-Power-Supply-adapter-100-240-AC-/350681440782?pt=US_Surveillance_Cables_Adapters_Connectors&hash=item51a63e220e

or


http://www.amazon.com/Switching-adapter-100-240-AbleGrid-Trademarked/dp/B00D1SRAMY/ref=sr_1_6?ie=UTF8&qid=1392151317&sr=8-6&keywords=24v+500ma+power+supply


21  Using Arduino / General Electronics / Re: Component requires 24v on: February 11, 2014, 12:52:46 pm
Um what component are you using and what is its current draw? The amount of current it needs will greatly affect the size. Also is it AC or DC???
22  Using Arduino / General Electronics / Re: Arduino Mega current supply??? on: February 11, 2014, 11:19:29 am
Is there a general range of current output at 7.4v?   Like  less then 500mA or something.  I don't want to burnt the thing up!  

Also, would a heat sink help?


EDIT: I added everything up and I should need less then 300 mA from the 5v pin at any given time.
23  Using Arduino / General Electronics / Re: Arduino Mega current supply??? on: February 11, 2014, 08:12:47 am
I did not mean that I'm supplying power to the servos from the Mega!  That would obviously be way to much current of the Arduino to handle. I'm just controlling them with the mega which can still eat up a small amount of current.

Does anybody have the data sheet to the voltage regulator so that I can calculate how much current I will be able to supply. I will be using a 7.4v battery. Thanks!
24  Topics / Robotics / Re: help to build an ir transmitter on: February 10, 2014, 08:10:27 pm
This should help you out...

https://learn.sparkfun.com/tutorials/ir-control-kit-hookup-guide
25  Community / Gigs and Collaborations / Re: RE: Interested in making $ for a little freelance project? on: February 10, 2014, 08:08:27 pm
Well before anybody can write code we will need to know what motor driver you are using, and what Arduino is in use.  Also, what push button? They can very.


This is also in the wrong spot.
26  Using Arduino / General Electronics / Arduino Mega current supply??? on: February 10, 2014, 08:05:53 pm
Hello,

 I'm working on a project that has many sensors/servos/relays and a RGB LED and a lcd screen. I want to make sure I'm within the bounds of the onboard voltage regulators. I know that I can supply 50ma from the 3.3 v pin which should cover my sensors, and that I can supply up to 50 ma from each digital out put which will be good for my RGB led, but what is the total current limit of the 5v regulator that the Mega has. I cannot find any specs. If worst comes to worst I will just use a  separate voltage regulator, but I would rather not.  smiley

Thanks,
Drew Davis
27  Topics / Robotics / Re: Line Follower with one sensor - Help to improve the code on: January 30, 2014, 08:31:11 am
Please explain what does not work.
28  Using Arduino / Project Guidance / Re: Simple Power Switch Help on: January 07, 2014, 04:56:12 pm
First off what power supply are you using? It might not have enough amperage output  to power both things. If it does you could splice the wires or if you want to buy something pre made use this. 
https://www.sparkfun.com/products/11705


 Before ordering your splitter and the switch make sure your power supply has a high enough amperage rating if not use this .

https://www.sparkfun.com/products/8269



Best of luck!
29  Using Arduino / Project Guidance / Re: Plug two devices that communicate through Serial on Arduino Uno on: January 07, 2014, 04:50:47 pm
I would believe  that it can be done, but I would just go with the mega if possible. Would take a lot less work.
30  Using Arduino / Project Guidance / Re: xbee wireless communication on: January 07, 2014, 04:45:51 pm
Are you still working on this?
Pages: 1 [2] 3 4 ... 41