Loading...
  Show Posts
Pages: 1 ... 102 103 [104] 105 106 ... 164
1546  Using Arduino / Programming Questions / Re: menu question on: June 29, 2012, 04:18:32 pm
Is this the function you are asking about?

Code:
void menuChanged(MenuChangeEvent changed){

  MenuItem newMenuItem=changed.to; //get the destination menu

  lcd.setCursor(0,1); //set the start position for lcd printing to the second row

  if(newMenuItem.getName()==menu.getRoot()){
      lcd.print("test 1      ");
  }else if(newMenuItem.getName()=="Item1"){
      lcd.print("Item1           ");
  }else if(newMenuItem.getName()=="Item2"){
      lcd.print("Item2           ");
  }else if(newMenuItem.getName()=="Item3"){
      lcd.print("Item3           ");
  }
}

If so, what don't you understand about it?
1547  Using Arduino / General Electronics / Re: Relay Wiring on: June 29, 2012, 04:15:29 pm
With a transistor "on" is with the base pulled away from the potential of the emitter.

For an NPN transistor that would be a positive voltage WRT emitter (usually ground).  For a PNP, the emitter is usually connected to Vcc, so it would be a negative voltage WRT Vcc, so anything below Vcc (i.e., VOL, or "logic low").
1548  Using Arduino / Programming Questions / Re: menu question on: June 29, 2012, 04:09:25 pm
Handmade crochet bag with coordinate necklace anyone?

If you don't follow this up with actual code, rather than a link to some random site, I'll flag it for the mods to delete as spam.
1549  Using Arduino / General Electronics / Re: DIY Electronics Learning Lab on: June 29, 2012, 01:43:55 pm
It's not mine - I destroyed mine.  Just an image google found for me.
1550  Using Arduino / Programming Questions / Re: Converting char to unsigned int? on: June 29, 2012, 01:41:44 pm
Then you're asking completely the wrong question.  We have answered the question you asked with the right answer.

You should be asking about string parsing, which is a completely different topic (and something already heavily covered in the forum).
1551  Using Arduino / Programming Questions / Re: How can I calculate processor usage? on: June 29, 2012, 08:46:31 am
A microcontroller is somewhat different to a PC.

A PC has many many tasks running concurrently, organized and managed by a scheduler.

A Microcontroller typically only has one task and no management.

A PC switches between tasks, timing the amount of time spent in each task, the amount of time spend handling interrupts, the amount of time spent doing system (kernel) tasks, and the amount of time when not doing anything.

A microcontroller is either running or it isn't.

If the microcontroller is running, then it is at 100% usage.  If it's not, then it's asleep and waiting to be woken by some interrupt (or it's turned off).
1552  Using Arduino / Programming Questions / Re: Blink Example Uploads but acts unexpectedly on: June 29, 2012, 06:50:25 am
That 3 flash burst sounds like the bootloader's indicator.  If that is repeating, then it sounds like the UNO is rebooting repeatedly.

If it's just 3 quick flashes before it settles down to a regular 1 second flashing, then that is fine.
1553  Using Arduino / General Electronics / Re: Problem with flashing Lled on arduino and board resetting on: June 29, 2012, 05:57:17 am
Quote
The Motors are powered from the arduino, which is running of 9v battery.

That's still too vague.

Are they running from the 5V?  from Vin?  How powerful are the motors?  What's the specs for them?  What kind of 9V battery?  Are you using an H-bridge? Please give us information.
1554  Using Arduino / Programming Questions / Re: Pressure differential sensor, analog input issue on: June 29, 2012, 04:43:28 am
Due to function overloading, if the first parameter is a floating point number the second parameter is taken as the precision, not the base.  OCT is a macro equating to 8...

That's not how to use it, in my opionon. I thinks it's even erroneous misusage of something not ment for it.

Oh, I never said it was right - I was just describing the effects of using it like that.

Quote
About the octal usage, only people using octal think that way...  smiley-wink I have used this long time ago (just once): http://en.wikipedia.org/wiki/PDP-11

I have an emulator for that smiley-razz
1555  Using Arduino / General Electronics / Re: Difference between CD74HC165E & 74HC165N on: June 29, 2012, 04:26:11 am
In general the prefix and suffix are specific to the manufacturer.  They often denote the package style, etc.

The important bit is the "HC" - High-speed CMOS, and the numbers - 74 logic series, device 165.
1556  Using Arduino / Programming Questions / Re: Pressure differential sensor, analog input issue on: June 29, 2012, 04:23:59 am
Is the sensor a flow sensor ? Can you tell which one and add a link to it ?  (just copy the url in the message).
In your code, the flow sensor must output 0V if there is no flow.

You use octal ('OCT') notation for a double precision floating point.
http://arduino.cc/it/Serial/Print
But the octal notation is only used by old programmer pioneers with long white beards.
Just use "Serial.println(volFlow);" to print a floating point number, or "Serial.println(volFlow,3);" with 3 digits after the comma. The same goes for the 'tank' variable.

Due to function overloading, if the first parameter is a floating point number the second parameter is taken as the precision, not the base.  OCT is a macro equating to 8, so printing a floating point number with OCT will yield a floating point number with 8 decimal place precision.  It will not display it as octal.

And I am neither old (well, not that old), and I don't have a grey beard (neither do I wear sandals), yet I do use octal on a daily basis.  It is no more "old fashioned" than hexadecimal - it's just a different way of grouping bits - 3 instead of 4.
1557  Using Arduino / General Electronics / Re: DIY Electronics Learning Lab on: June 29, 2012, 03:58:16 am
I cut my electronics teeth on this bad boy:

1558  Using Arduino / General Electronics / Re: Problem with flashing Lled on arduino and board resetting on: June 29, 2012, 03:55:44 am
Motor stall current too high causing voltage droop?

How are the motors connected and powered?
1559  Using Arduino / Programming Questions / Re: Converting char to unsigned int? on: June 29, 2012, 03:38:54 am
You can convert a char array to an integer using atoi:

Code:
char *in = "4793";
int out = atoi(in);

However, that creates a signed integer between -32768 and 32767.  For unsigned I would suggest using its sister function "atol" to convert to a signed long, then cast that back to an unsigned int.  That way the long can store the numbers greater than 32867, and the casting will retain anything between 0 and 65535.

Code:
char *in = "49283";
long temp = atol(in);
unsigned int out = (unsigned int)temp;
1560  Using Arduino / Programming Questions / Re: Char array not being remembered or overwritten on: June 29, 2012, 03:34:32 am
Code:
char data[1024];
char number[1024];
char message[1024];
char waste[1024];
On what Arduino?

On any Arduino with enough memory.

A better question is "What makes an Arduino an Arduino".  I have a system on my desk with 128K of RAM and 512K of Flash.  It uses the Arduino IDE.  It uses the Arduino libraries.  It uses Arduino shields.  It's programmed using avrdude... Is it an Arduino...?
Pages: 1 ... 102 103 [104] 105 106 ... 164