Pages: [1]   Go Down
Author Topic: Arduino Leonardo Stupid Bug  (Read 734 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all, again

I have posted some days ago a couple of topics regarding an Arduino Leonardo. None knew what needed to do.
The problem was that I couldn't get the sensory data from my sensor. It didn't read. The monitor was blank. No numbers. Nothing.

Regarding the sensor:
EVERYTHING it's made just as on the bildr tutorial. Don't ask what and how I did, because all the instructions are on bildr.com

So I went at my local retailer, thinking it was burned (the sensor).
There, at first, the same problem. It didn't worked. It hang out on the I2C. But then it worked somehow by removing the Serial.begin and other Serial.prints from the sensor class. Then it worked.

I got home, happy, I've connected it to my PC, and voila, everything was working like a charm.
To be sure that it's nothing wrong with it, I've reuploaded the SAME code it was on the Arduino at that moment. Then, NOTHING. It didn't work again. I don't have to mention that from that moment, I got only errors when I try to upload to my Arduino. Errors like "USB not recognized" and all this sorts of things. I have a 1/10 chance of having a successful upload (I have Win7 32-bit)

IT'S OBVIOUS that there's nothing wrong with the solderings and the sensor. It's something wrong with the Arduino.
What kind of Arduino is this? I mean, when I buy Arduino, I have some claims. It's a board that's recognized as a product that's easy to use and is bug-free. In this case, Arduino suggests not to be bought.

Can someone explain me what's the problem with this board? You know, I've spend so money to buy it, and I expect something in return.

And here's the library for my ADJDS311 sensor: http://bildr.org/?s=s311

RobertEagle
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8975
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That bildr project won't work on the Leonardo because on the Leonardo the I2C/TWI/Wire interface is on Pin 2 (Data) and Pin 3 (Clock) instead of Pin A4 (Data) and Pin A5 (Clock).  Since Pin 2 is being used to control the LED there will be a conflict if you use Pin 2 for both LED and Data.

Move the LED function to another pin (like Pin 4) and use 2 and 3 (directly or via the SDA and SCL pins near the AREF pin) for the I2C bus in place of A4 and A5.

See:
http://arduino.cc/en/Main/arduinoBoardLeonardo
http://arduino.cc/en/Reference/Wire
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Sr. Member
****
Karma: 9
Posts: 254
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you're using I2C you need to put pull up resistors (>1.8k) on the SDA and SCL lines.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry that I haven't mentioned already that the SDA/SCL pins are connected in the proper way. Also the LED pin is on 5.

THIS bildr project works flawless on the UNO R3, but not on the Leonardo. I don't have the money to buy a new one.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm sorry that I haven't mentioned already that the SDA/SCL pins are connected in the proper way. Also the LED pin is on 5.
So, effectively, you haven't provided us any code or schematics for what you are doing.  That's going to make it difficult to help.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Full Member
***
Karma: 0
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The truth is that I have provided you the source code. It's just at 1 click away. I've mentioned earlier the link to the bildr tutorial.
That tutorial has both the library and the Arduino example.

Here's again the project: http://bildr.org/?s=s311
« Last Edit: April 26, 2013, 11:34:28 am by RobertEagle » Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why wouldn't you just simply show the code you are using, you have made some changes already?

Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Offline Offline
Sr. Member
****
Karma: 9
Posts: 254
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The truth is that I have provided you the source code. It's just at 1 click away. I've mentioned earlier the link to the bildr tutorial.
That tutorial has both the library and the Arduino example.

Here's again the project: http://bildr.org/?s=s311
That tutorial is using pins 2,3,5 and 6 for the various LEDs, does your code definitely do this? As far as we know it doesn't so that's what we can guess it the problem. For help that doesn't consist of guesses, attach your code.
The Leonardo, and more importantly the underlying micro-controller, has been heavily tested. The I2C interface works, if you can't get it to work then it's probably the code or circuit that's wrong.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The truth is that I have provided you the source code. It's just at 1 click away. I've mentioned earlier the link to the bildr tutorial.
That tutorial has both the library and the Arduino example.
No.  It isn't one-click away.

You have wired your circuit different with a different board using different pins, which means you also had to make code changes.  You have to show us your circuit and code, not someone else's.

If you are using the exact code on that page but have wired up the pins differently (as you stated before), then of course things may not work.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't ask what and how I did
What did you do and how did you do it?
Logged

Colorado
Offline Offline
Edison Member
*
Karma: 47
Posts: 1562
Reviving dead brain cells with Arduinos.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And you wonder why no one knew what needed to happen, when you don't show code or schematic of how you have things connected?  As many have already pointed out, the bildr tutorial uses a different board than what you're using.  The code uses pins which are known to cause conflict on the board that YOU are using.  So, by claiming that you have not changed anything, and you did everything exactly the same as the bildr tutorial, you can not expect any other result than it not working because of the aforementioned conflict.

Now we ask you to show what changes you've made and you don't show us, and you expect help?  Good luck with that.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 183
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It doesn't matter anymore which pin is how, which instruction is where, or anything related to this.

I found the problem. I was running on the Arduino IDE 1.0.1. I got the new 1.0.4 and it worked. It seemed that the old version didn't go well with the library and the Leonardo. It wasn't a problem of wiring or code, but a problem of version.

I withdraw any bad marks that I gave Arduino,
RobertEagle
Logged

Pages: [1]   Go Up
Jump to: