Show Posts
Pages: 1 ... 282 283 [284] 285 286 ... 411
4246  Using Arduino / Project Guidance / Re: Does this IC exist? on: December 02, 2011, 11:38:51 am
ICs are created and sold for use in applications.  Explain the application you are trying to solve instead of the parts.  That will help you find if the IC exists and help others suggest what you need.
4247  Using Arduino / Programming Questions / Re: I2C lcd on: December 01, 2011, 11:55:44 pm
So I am not sure what you mean rapped in code tags
You paste your code.  Then highlight it.  Click the '#' button in the post editor.  You'll see what "code tags" are.


I'm really not certain I understand what this new code you posted has to do with your original I2C question.  The new code you posted doesn't make use of the I2C library and all of the digital I/O pins are consumed so you can't use a parallel LCD.  I suspect you're making some kind of step forward (or backward) and leaving the details of that step out.

lcd.begin() should only be called once, which means it should only be in setup(), not in loop().

"Not in scope" is the complier's way of saying it doesn't know what a variable is.  In this case, you have not defined lcd anywhere in the sketch.  You should have created a global variable called lcd.  Global variables go outside of setup() and loop().  It needs to be global so you can call "lcd.begin()" in setup() and then use in loop().

From the "Hello World" example of the LiquidCrystal library:
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);  // <-- this is the line that defines the object/variable "lcd"  the rest of the numbers are related to how the parallel LCD is wired.  **THIS IS HAS NOTHING TO DO WITH YOUR I2C DISPLAY.

void setup() {  // set up the LCD's number of rows and columns:
  lcd.begin(16, 2);
4248  Using Arduino / Programming Questions / Re: I2C lcd on: December 01, 2011, 10:05:09 pm

The small code I entered above still compiles and runs ok. I trying to add this to code which ran fine in the original LiquidCrystal library.
So far I have added the first three lines of the above code to it, and I am still getting the same errors,here are those errors.

It is good to post the error messages you are getting.  However, instead of providing a cryptic scavenger hunt, why not post the code (wrapped in code tags, provided by the '#' button in the post editor) that isn't working?  Personally, I can't follow your directions and duplicate the problem.  E.g, especially the vague part of "I have added..." what did you add?
4249  Using Arduino / Installation & Troubleshooting / Re: Arduino IDE Crash on Mac OSX when uploading on: December 01, 2011, 07:02:31 pm
What version of the Arduino IDE are you using?
4250  Using Arduino / Programming Questions / Re: I2C lcd on: December 01, 2011, 06:48:41 pm
Your screenshots are better than nothing, but realize you completely obscured the path.  There is enough there for me to see that you didn't listen to my original advice.

Unzip it and put it in your libraries folder.  If you don't have a libraries folder, where your other Arduino sketches are stored, create one.

Your Sketches are stored in the path:
(XP) C:\Documents and Settings\username\Arduino\
(7)  C:\Users\username\Documents\Arduino\

That's where you need to create a libraries folder for you to put YOUR downloaded libraries.

See my screen shots.
User owned libraries:  path where Arduino.exe stores your sketches

libraries contents and LiquidCrystal_I2C contents are the contents of the respective folders.

Contributed libraries in IDE shows how LiquidCrystal_I2C appears correct in the IDE.
4251  Using Arduino / General Electronics / Re: Most affordable power supply solution? on: December 01, 2011, 06:29:17 pm
Yes you should always measure with a proper load.  The definition of proper will vary.  For example, if you know your circuit will draw 1A, don't measure the supply with 100mA and vice versa. 
4252  Using Arduino / General Electronics / Re: Arduino > Movie player on: December 01, 2011, 10:21:52 am
Current limiting resistors are always a good idea, especially if you don't know what the other side of the circuit looks like.
4253  Using Arduino / General Electronics / Re: Voltage regulator on: December 01, 2011, 10:15:22 am
Generally regulators have a minimum load requirement before their output is stable.  You might try a load of a 10K resistor just to get some current flowing.  This combined with the relatively large capacitors you are using could be keeping the regulator from stabilizing its output.  (The datasheet only recommends 0.33uF on the input and 0.1uF on the output.)

Of course if your goal is 3.75V then zoomkat's suggestion is best of all.  Just go straight for an adjustable regulator.
4254  Using Arduino / General Electronics / Re: Most affordable power supply solution? on: November 30, 2011, 05:55:09 pm
I use these Apple-knock off adapters to get 5V into my enclosed projects.  $5 (with prime.)

You can get them even less in bulk without prime or on eBay.

Second -- can you buy those circuit boards from within the wall warts bulk? Or some other kind of mains-to-5V power supply component already built? If I could get < $5 for this part, that would be a win for me!
I've never felt the need to put the circuit inside my boxes.  I'd rather run a small DC cable into the box than mains power, but that's just my preference.
4255  Using Arduino / Programming Questions / Re: millis rollover on: November 30, 2011, 03:16:48 pm
it can cause the arduino to lock up.
The term "lock up" is so over used that it is meaningless.  Mishandled events could cause code to operate unexpectedly, but the microcontroller will still continue to execute instructions.

You might be interested in this write up on handling roll over:
4256  Using Arduino / Programming Questions / Re: C++ code converting to Arduino on: November 30, 2011, 03:11:33 pm
About the syntax errors, that's the problem, I'm not familiar with Arduino languge, so I couldn't figure out what kind of error I made.
Again, there is no such thing as "Arduino language."  The Arduino is programmed with C++.  Your syntax errors are C++ errors.

   for (i=0; i<nterms; i++){
      a = 1;
a is an array.  So what does a = 1 mean?  You do this again later on in func():
value = c[2]*x + c[1]/x + c[0];   /*van deemter equation*/
x is an array. 

As AWOL points out, if you are getting errors you need to ask about the specific errors.  Just posting code and saying "this doesn't work" won't you get any closer to a solution.  You need to explain what isn't working.
4257  Using Arduino / Programming Questions / Re: C++ code converting to Arduino on: November 30, 2011, 01:18:57 pm
Sorry that I didn't mentioned this is just Sub-function of program.
Posting only parts of code makes it difficult to help troubleshoot.  You might have identified the part that is not working, but the cause could be elsewhere.

I'm using 'Ardupilot Mega' (126kb) board, and I'm using only 15kb except this I don't think this is the capacity problem.
We are not suggesting a capacity problem.  Code is stored in Flash Memory which is 128kb.  Your program runs in SRAM which is only 8k...  The complier does not report or check if you are using too much SRAM.

As I told, I need to check that I put wrong command or unusual expression on the code.
The code, as posted, has many syntax errors.  Most members of this forum will not troubleshoot code that does not compi unless the question is "why doesn't this compile?".
4258  Using Arduino / Programming Questions / Re: C++ code converting to Arduino on: November 30, 2011, 12:50:36 pm
This is my Arduino Code.
The problem is C++ code find the correct function, but Arduino is not.
There is no such thing as "Arduino Code."  Arduino is coded in C++.

int param, iteration, nloops, n, cycle, nfree;
12 bytes

int npts;   /* Number of data pairs */
2 bytes

double x[maxnpts], y[maxnpts], sigmay[maxnpts]; /*x,y,y, uncertainty*/
156 Bytes

double weight[maxnpts];  /*Weighting factor*/
52 Bytes

double yfit[maxnpts]; /*calculated values of y*/
52 Bytes

double a[nterms], sigmaa[nterms], b[nterms]; /*a=c params*/
36 Bytes

double beta[nterms], c[nterms]; /*To be fit by program*/
24 Bytes

double finala[nterms], lastsigmaa[nterms];
24 bytes

double alpha[nterms][nterms], arry[nterms][nterms];
72 Bytes  // someone may need to check me on this one

double aug[nterms][nterms*2];   /*For matrix inversion */
72 Bytes

double deriv[maxnpts][nterms];   /*Derivatives */
36 Bytes

double flambda; /*Proportion of gradient search(=0.001 at start)*/
4 Bytes

double chisq; /*Variance of residuals in curve fit*/
4 Bytes

double chisq1, fchisq, sy;
12 Bytes

Right out of the gate you are using 558 bytes of SRAM be mindful of that.

If you are compiling this code in the Arduino IDE you should have a void setup() function that does any one time operations (like Serial.begin()) and a void loop() which is much like a void main().  Neither of those appear in the code you posted.  Additionally there are many places in your code where you refer to arrays like 'a' and 'x' but don't give any indexes.  So the code you have posted doesn't even compile.
4259  Community / Website and Forum / Re: This is an old picture, right? on: November 30, 2011, 02:07:55 am
And, unlike the original Uno launch photos, the ATmel isn't installed backwards.
4260  Community / Website and Forum / Re: Should we get rid of polls? on: November 30, 2011, 02:06:29 am
It seems to me that if polls were disabled unless your post count was above 1, this issue would be addressed.
Pages: 1 ... 282 283 [284] 285 286 ... 411