Show Posts
Pages: [1]
1  Using Arduino / General Electronics / Re: Rotary encoder works one way but not the other. on: February 08, 2012, 05:02:19 pm
I bet I can sound even more stupid. OK, you have realized that the center pin is not ground. Will you PLEASE tell us where you connect it, if not to ground?

I'm trying to get this to work too, and like you all I have in the way of a hookup diagram is mfr datasheets. Apparently no one in Arduino land thinks its necessary to post a hookup diagram. grr.

[later same day]

OK, updating my own post here. The problem here was me trying to use the "test circuit" from the datasheet. A and B pulled up to 5V with 10K resistors, C to ground.

None of that is needed on the Arduino, which has its own configurable internal pull up resistors. (you set it up with a command like pinMode(5, HIGH) for internal pull up) I directly connected my encoder pins A to 5, B to 6, C to gnd.
C is the middle pin! like this: ACB

(I designated 5 and 6 instead of 2 and 3 in the example code above) It works like it's supposed to. 
2  Using Arduino / Programming Questions / Re: Questions about #include statements in sketches on: February 04, 2012, 02:54:20 pm
Thanks James, you are correct about the libraries subfolder in sketches. After I tried it, shazam! Sketches compile and upload.

And embarrassingly enough, I find that your statements are echoed in the "official" Arduino Reference.

This from the reference/libraries page:

Quote
Contributed Libraries

If you're using one of these libraries, you need to install it first. To do so, download the library and unzip it. It should be in a folder of its own, and will typically contain at least two files, one with a .h suffix and one with a .cpp suffix. Open your Arduino sketchbook folder. If there is already a folder there called libraries, place the library folder in there. If not, create a folder called libraries in the sketchbook folder, and drop the library folder in there. Then re-start the Arduino programming environment, and you should see your new library in the Sketch > Import Library menu.


I think I MAY be past that very steep part of the learning curve I think of as "the hair pulling stage".
3  Using Arduino / Programming Questions / Re: Questions about #include statements in sketches on: February 04, 2012, 01:47:28 pm
http://arduino.cc/forum/index.php/topic,88380.msg664107.html#msg664107

The above linked message seems to be an authoritative answer to one of my questions.

The poster says libraries (and from context I gather he means "non-standard" libraries, like the USB-2.0 library)
should go in a subfolder of the sketches directory. In my case that's /home/[me]/sketchbook/

I'm going to try that, creating a /libraries/ subfolder and placing the USB 2.0 library there.

Why is this all so "not specified"?  smiley-mad Why must one dig, dig, dig for "opinions" in the forums, instead of being able
to just read "the straight skinny" from the Arduino Reference???
4  Using Arduino / Programming Questions / Questions about #include statements in sketches on: February 04, 2012, 12:44:41 pm
I've had my ATmega 2560 for some time, and experimented with the Robot Power MegaMoto shield. I made lots of mistakes, but I learned from them.

I'm using the newest Arduino IDE version 1.0 on an ubuntu machine. I have it located in a folder in my Public directory. I know a few things about Linux/Ubuntu, but I'm not sure that's the correct place for it. And the Arduino libraries are there too.

However I discovered the libraries are also at /usr/include/arduino/libraries/  .  Maybe this is left over from the previous install of Arduino 0022 (or whatever it used to be) Is my new Arduino IDE version 1.0 looking at that location? or at the libraries unpacked and located in my Public folder?

I wouldn't have discovered all of the above except I now have the Circuits@Home USB Host Shield. I've downloaded the Library for it, which includes a folder of Examples. Many of these example sketches (they have .pde extensions)  have #include <something.h> directives in them.

I did some googling and learned that the carets around the file name indicate that the file is "somewhere else".  I can't find any sort of Setup or Preference that explicitly defines where "somewhere else" is.

The demo sketches included in the Examples for the USB Host Shield library throw all sorts of errors when I try to Verify them.
mainly "file does not exist" regarding all those #include <????.h> lines.

I tried copying all the named files to the folder containing the sketch, and changing the lines to read #include "????.h", which as I understand it, tells the compiler to look in the "local directory".

That's a lot of work, and I'm sure it's NOT the best way. However, doing this seems to get rid of the "file does not exist" errors. The sketch seems to verify/compile, but I still can't get it to upload to my Arduino/shield combo.

I'm in that "how do I figure out what question to ask" stage with this, please bear with me and if you can offer some insight, thanks!
5  Using Arduino / Installation & Troubleshooting / MegaMoto pins short out on Mega 2560 USB connector on: July 12, 2011, 03:08:36 pm
 smiley-red  I thought there was some problem with the USB connector itself!

   I had installed a MegaMoto shield on my Arduino Mega 2560, but It seemed I had to apply
downward pressure to the USB plug that was inserted in the USB jack on the Mega 2560,
to get my motor to turn!

   I got to looking at the situation and I discovered that the ENABLE jumper pins protruding through
the bottom of the MegaMoto pc board were in contact with the metal cover of the USB jack on the
Mega 2560.

   My quick-and-dirty fix was to super glue a thick square of non-conductive plastic sheet to the
top of the USB jack on the Mega 2560

  It seems good practice (in general) to use long threaded machine screws and some hex nuts to position
shields safely above the main board, in order to avoid situations like this one.
6  Using Arduino / Installation & Troubleshooting / Re: Can only upload sketches as 'root'? on: June 11, 2011, 10:23:11 pm
Thank you.  smiley-red
7  Using Arduino / Installation & Troubleshooting / Re: Can only upload sketches as 'root'? on: June 11, 2011, 10:09:04 pm
Arrghh1

NOW it's working.

I changed nothing.

Only difference is a reboot performed earlier today.

8  Using Arduino / Installation & Troubleshooting / Re: Can only upload sketches as 'root'? on: June 11, 2011, 10:05:42 pm
dexternew@esposa-segunda:~$ ls -l /dev/ttyACM*
crw-rw---- 1 root dialout 166, 0 2011-06-11 19:55 /dev/ttyACM0

I created the group dialout, and placed dexternew in it.

Every time I think I understand what's supposed to be happening,
I find out I really don't.

More help needed.
9  Using Arduino / Installation & Troubleshooting / Re: Serial port '/dev/ttyACM0' not found on: June 11, 2011, 04:17:55 pm
Ubuntu 11.04, IDE 0022

I just got a mega2560...

I notice I must log in as root in order to set the serial port to ttyACM0 as required.

(do dmesg with your board plugged into USB...you should see that.)


if I log in as anyone other than root, that option is greyed out.

I've posted a new topic about this.

10  Using Arduino / Installation & Troubleshooting / Can only upload sketches as 'root'? on: June 11, 2011, 04:14:42 pm
 smiley-razz I just got a mega2560.

if I log in as root, I can upload, because ttyACM0 is selected under
Tools>Serial Port in the IDE


BUT if I log in as someone else...(non-root)
then I can't upload, because the IDE is looking for
COM1 and the Tools>Serial Port menu item is greyed out.

Ubuntu 11.04, IDE 0022

Please advise...thanks
Pages: [1]