Show Posts
Pages: [1] 2 3 ... 44
1  Using Arduino / Programming Questions / Re: true false help? if (!variable){} on: Today at 12:05:48 pm
If you print true, it is true you get a 1.  But that doesnt mean 1 is true and 0 is false.  Actually it is 0 is false and anything that is not 0 is true.
2  Using Arduino / Programming Questions / Re: Does my Arduino ignore its serial buffer? on: April 01, 2014, 08:18:03 pm
You're making a classic mistake.  You check that there is a byte to read in the serial buffer then try to read a whole bunch of them.  Serial data comes slow, much much slower than your Arduino executes code.  So you get a byte and you read it and it is an A and you go to parseInt but the number hasn't shown up yet. 

You should either check to make sure all of your characters have arrived by checking Serial.available against a larger number or restructure the code to just check the serial buffer each time through the loop and hang on to what it's got until it gets a complete message and only act once it has processed the whole thing. 
3  Using Arduino / General Electronics / Re: another soldering quesition - perhaps incorrect use of flux? on: March 28, 2014, 08:22:22 pm
2) Clean the tip of my iron and drop just a little bit of solder onto the end to get some fresh tinning/solder blob on it. 

I've tried this, but haven't gotten it to work yet.  I've cleaned the tip with flux, and I clean it with the sponge.  I let the iron get hot.  When I apply the solder to the tip, the solder doesn't flow onto the tip.  It just bunches up into a ball at the end of the length of solder in my hand.

My soldering iron seems to repel solder.

This same thing happens to me.  I've looked at all the tutorials and they make it sound so easy, just touch the tip to the solder and now on to the next step...

I need a video maybe.  Or maybe one of us should make a video of what happens to us and someone can try to explain what we're doing wrong. 
4  Using Arduino / Programming Questions / Re: help with significant figures on percentages on: March 22, 2014, 06:13:27 pm
I think you don't understand significant figures.

A percent with two digits as an integer like 15% or 43% has exactly 2 significant figures. 

Your statement that you want all the sig figs that you can get tells me you really don't know anything about sig figs.  The number of sig figs available to you is a consequence of the inputs and not the calculation.  You don't get to pick and choose.  If you want more sig figs coming out then you have to give more sig figs going in. 
5  Using Arduino / Programming Questions / Re: Use another pin like pin 13 on: February 27, 2014, 03:28:48 pm
I tryied to use a 10k resiston on the output and plugged on pin 2 but dont worked

What do you mean?  One end of the resistor went to pin 2, got that.  Where was the other end of the resistor connected?
6  Using Arduino / Programming Questions / Re: Use another pin like pin 13 on: February 27, 2014, 01:29:10 pm
I would guess it's because 13 has the built in LED and maybe that is sort of acting like a weak pull-down.

Either way, it sounds like it's time to learn about pull-up and pull-down resistors.
7  Using Arduino / Programming Questions / Re: Problem with return tangent of x on: February 27, 2014, 10:19:41 am
Code:
a=tan(double(x/y));

Since you've defined tan to be nothing, this will condense down to:

Code:
a=(double(x/y));

And since x and y are integers and x is smaller than y the answer here will be 0.  And that's what you're getting.
8  Using Arduino / Programming Questions / Re: Problem with return tangent of x on: February 27, 2014, 10:18:04 am
Code:
double; a=tan(double(x/y)); //a= tan^-1 (x/y) , exprimé en degrés (la fonction donne un angle en radians)

What's the double with the semicolon doing at the beginning?  I think that should go away.

Was it meant to be a cast?  That's not how you do a cast.
9  Using Arduino / Programming Questions / Re: Coding an XOR on: February 25, 2014, 11:10:58 pm
If you had something like ^^ for boolean XOR couldn't it end up becoming really ambiguous? 

A && B && C      makes sense
A || B || C       makes sense

A XOR B XOR C          WTF???
10  Using Arduino / Programming Questions / Re: Boolean Variables on: February 20, 2014, 07:10:22 pm
figitalRead --  returns TRUE if someone fidgets with the pin?
11  Using Arduino / Programming Questions / Re: what the "%" is for? on: February 20, 2014, 01:23:15 pm
Did you look?  It's only ever used one way.

Look here in the reference section:  http://arduino.cc/en/Reference/HomePage#.UwZJmoU4uzY

On the left hand side under arithmetic operators.  It's called modulo.

Hell, here's a link to that if getting to it from the reference page is too hard for you.

http://arduino.cc/en/Reference/Modulo#.UwZJ8oU4uzY

12  Using Arduino / Programming Questions / Re: Crashing when sending analogwrite value above zero on: February 11, 2014, 07:27:47 pm
My first guess is that something is wrong in the code.  But since i cant see the code i can tell you what i migh be.
13  Using Arduino / Programming Questions / Re: Ardunio is not accepting integers bigger than 9 on: February 10, 2014, 09:42:16 am
Code:
void loop() {
 int ch = Serial.read();
   switch(ch) {

      case '10':
        myservo.write(10);
        break;
      case '20':
        myservo.write(20);
        break;
       case '30':
        myservo.write(30);
        break;
  }
  }

So at the top of the loop you read one character.  Just one character.  How can you ever get more than one digit?  If you send 43 that will send the 4 and then the 3.  But you only read one character, so you only get the 4.

Then in the switch case you have this nonsense.  '30'   Single quotes are for single characters.  You can't cram a bunch more characters in there and expect it to become a string.  This isn't python.  

If you want to read things more than one character long then you'll need to keep reading until you get to the end of what you sent.  Then you'll need to convert that from ascii characters into a real number that you can use in your switch case.

14  Using Arduino / Programming Questions / Re: How to get the next consecutive ASCII character? on: February 09, 2014, 11:29:12 am
Is inputString a String variable?  If so I can't help you.

If inputString is a char variable then it's easy.  Just add 1. 

Code:
char ch = 'A';
ch += 1;
Serial.print(ch);

Will print
Code:
B
15  Using Arduino / Programming Questions / Re: how to hold last increment value on: February 06, 2014, 08:54:33 pm
Good news.  Until you change it, y will still have its old value. 
Pages: [1] 2 3 ... 44