Show Posts
Pages: 1 2 [3] 4 5 ... 66
31  Using Arduino / Project Guidance / Re: Power supply question on: July 14, 2014, 08:16:13 am
Yes this could work but are you sure 0.6A is enough current to power both arduino and your pump ? I really doubt it.


By the way, if you use step down module like this one:


Their output is limited to 2A (up to 3A if you add a heatsink on the LM2596) but this should be more than enough for your pump.


The question is: how much current is required by your pump? Any marking about current or power?
32  Using Arduino / Programming Questions / Re: why do we use int instead of long on: July 13, 2014, 03:19:34 pm
Who "we"? Bad practice from the examples on the playground and on the forum.

I always use the appropriate variable type, even if I use an Arduino Mega 2560. Even then, I try to optimize as much as possible, such as using bitwise operations to store for example 2 numbers ranging between 0 to 15 in a single byte, or 8 booleans in a single byte...
33  Using Arduino / Programming Questions / Re: why do we use int instead of long on: July 13, 2014, 01:55:36 pm
Hello and welcome,

Long take twice more memory than int, on devices with limited memory you have to consider using the smallest variable possible smiley-wink

For example if you are sure your number will range between 0 and 255, then you should use a variable of type byte (or "uint8_t", same thing) which take one byte. An int take 2 bytes, a long take 4 bytes.
34  Using Arduino / Programming Questions / Re: Gps coord to gsm sms on: July 10, 2014, 04:42:04 pm
Hello,

Try something like this:

Code:
mySerial.print( "AT*EAPP=0,0,\"" );
mySerial.print( myChar );
mySerial.println( "\"" );

Or you try sprintf, or strcat, whatever.. smiley-wink
35  Using Arduino / Installation & Troubleshooting / Re: ide error message "avrdude stk500_getsync(): not in sync: resp=0x00" on: June 30, 2014, 04:22:39 pm
Ahhh n00b ! J/K smiley-wink
36  Using Arduino / Programming Questions / Re: Make something happen only once with a digital input on: June 30, 2014, 01:01:36 am
Hello,

Read this carefully first:

http://gammon.com.au/switches

Especially the parts Detecting transitions, and Debouncing Without Delay


Then you will have to do something like this:
Code:
//top of your code
uint8_t sequenceId = 0;

//when button is pressed
if ( button_was_pressed )
{
  // increase sequenceId, and reset if greater than 2 (so it goes 0, 1, 2, 0, 1, 2 etc... )
  if ( ++sequenceId > 2 )
    sequenceId = 0;

  // here is where you should clear and write the matrix.
  // this is a good idea to use a switch statement here, instead of your multiple if statements
}
37  Using Arduino / Programming Questions / Re: Hall Effect Sensor A3144 -help on: June 29, 2014, 09:00:49 pm
I'm really not sure about the max frequency of these kind of sensors (nothing about it in the datasheet), but it's probably much more than you need.

Can someone correct me if I'm wrong smiley-wink
38  Using Arduino / Programming Questions / Re: Hall Effect Sensor A3144 -help on: June 29, 2014, 08:02:26 pm
Hello,

No problem it will work, and for a much higher speed than you can go with a bicycle smiley-wink

Don't forget that you have to solidly attach a magnet to the wheel. I recommend that you buy something like this:
or
Search "sigma magnet" on ebay
39  Using Arduino / Programming Questions / Re: ds3231 and time libraries on: June 29, 2014, 03:31:33 pm
Hello and welcome,

Follow this tutorial: http://www.l8ter.com/?p=417
40  Using Arduino / General Electronics / Re: Basic Power Supply Question: Amp requirements for shared power supply on: June 29, 2014, 02:50:29 pm
Yes at least 4.2A but I would recommend at least 6A
41  Using Arduino / Programming Questions / Re: Arduino <--> Serial on: June 28, 2014, 11:19:16 pm
NP and glad you got it working smiley-wink
42  Using Arduino / Programming Questions / Re: Arduino <--> Serial on: June 28, 2014, 11:00:34 pm
No you didn't understand, but this is probably because I have a hard time trying to write english smiley

You can send not only from that textbox, but from any devices (or programs) capable of sending data to a serial port.

I know Processing can do that, but I've never used it. See here: http://www.processing.org/reference/libraries/serial

What you want to do is just not possible with the Serial monitor. But it will be possible with Processing:

1) Arduino send message
2) Processing read message and send it back to Arduino
3) Now in the Arduino, Serial.available will be greater than 0 so it will execute your if statement






43  Using Arduino / Programming Questions / Re: Conversion on: June 28, 2014, 10:38:48 pm
I guess it should be:

Instead of:
Code:
float positionSensor = ( ( positionSensorVolts-0.5 ) / ( 4.5 - 0.5 )) * 100.0 ;

positionSensor = ceil(positionSensor);   // <<<<< round to the following integer
Use:
Code:
uint8_t positionSensor = (uint8_t) ceil( ( ( positionSensorVolts-0.5 ) / ( 4.5 - 0.5 ) ) * 100.0 );

And then add:
Code:
lcd.print(positionSensor);
just before:
Code:
lcd.println ("% ");
44  Using Arduino / Programming Questions / Re: Arduino <--> Serial on: June 28, 2014, 10:26:05 pm
No, you can of course read data from another serial device smiley-wink

But when you do Serial.print, you just output data from the arduino to another device, such as the serial monitor from the Arduino IDE which just show in a window the message that was received. The serial monitor will not re-send the message back to the arduino as this is pointless. You can send data from the serial monitor to the arduino by typing whatever in the Textbox at the top and press Send.

By the way, welcome smiley-wink
45  Using Arduino / Programming Questions / Re: Arduino <--> Serial on: June 28, 2014, 10:10:32 pm
Serial.available() will only be true greater than 0, if there is something in the input buffer. Actually you just output things. If you want that your print messages go back into the arduino, place a wire between TX and RX smiley-wink
Pages: 1 2 [3] 4 5 ... 66