Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 1898
61  Using Arduino / General Electronics / Re: Ohm's Law. on: August 30, 2014, 12:05:22 pm
{ sad, resigned sigh}
Code:
Vout = (5.0 / 1024.0) * raw;
62  Using Arduino / Programming Questions / Re: for loop like basic? on: August 30, 2014, 11:35:16 am
Code:
or (int i = -4;;i++)
+ or - Increminting should be automatic. Why specify ++ or -- The compiler should figure that out.



How is the compiler supposed to know to count up or count down?
You may want a deliberate wrap.
63  Using Arduino / Programming Questions / Re: Understanding Code on: August 30, 2014, 06:20:55 am
Quote
what is the define part of this code exactly doing
It's telling the library which pins on the I2C I/O expander are connected to which pins on the LCD.
64  Using Arduino / Programming Questions / Re: Problem with this Sketch on: August 30, 2014, 06:15:12 am
sp. "println", not "print1n"

(short for "printline")
65  Using Arduino / Programming Questions / Re: Serial.print (TCCR1B, BIN); gives me nothing on: August 30, 2014, 06:13:19 am
Code:
if (b < pow(2, i))
Using "pow" is a sledgehammer to miss a nut.
Thank you AWOL, I appreciate you very much, but ...

can you say is a sledgehammer to miss a nut in other words I can understand?

(Sorry, I am just a 'foreigner')
The more usual cliche is "take a sledgehammer to crack a nut", meaning to use an inappropriately heavy-handed method to solve a trivial problem.
However here, using "pow()" to calculate powers of two is the sledgehammer that will not hit the nut, as I shall now demonstrate :
Code:
void setup ()
{
  Serial.begin (115200);
  for (int i = 0; i < 32; i++)
  {
    uint32_t x = pow (2, i);
    uint32_t y = 1UL << i;
    if (x != y)
    {
      Serial.print ("Oops ! i = ");
      Serial.print (i);
      Serial.print (", x = ");
      Serial.print (x);
      Serial.print (", y = ");
      Serial.println (y);
    }  
  }
}

void loop ()
{}


Code:
Oops ! i = 2, x = 3, y = 4
Oops ! i = 3, x = 7, y = 8
Oops ! i = 4, x = 15, y = 16
Oops ! i = 5, x = 31, y = 32
Oops ! i = 6, x = 63, y = 64
Oops ! i = 7, x = 127, y = 128
Oops ! i = 8, x = 255, y = 256
Oops ! i = 9, x = 511, y = 512
Oops ! i = 10, x = 1023, y = 1024
Oops ! i = 11, x = 2047, y = 2048
Oops ! i = 12, x = 4095, y = 4096
Oops ! i = 14, x = 16383, y = 16384
Oops ! i = 15, x = 32767, y = 32768
Oops ! i = 16, x = 65535, y = 65536
Oops ! i = 18, x = 262143, y = 262144
Oops ! i = 19, x = 524287, y = 524288
Oops ! i = 20, x = 1048574, y = 1048576
Oops ! i = 22, x = 4194298, y = 4194304
Oops ! i = 23, x = 8388597, y = 8388608
Oops ! i = 24, x = 16777194, y = 16777216
Oops ! i = 27, x = 134217552, y = 134217728
Oops ! i = 28, x = 268435104, y = 268435456
Oops ! i = 30, x = 1073740416, y = 1073741824
Oops ! i = 31, x = 2147480832, y = 2147483648

Quote
(Sorry, I am just a 'foreigner')
Hey! Me too!
66  Using Arduino / Programming Questions / Re: Serial read more than 64 bytes? on: August 29, 2014, 03:29:26 pm
More likely what is wrong is moving the data around at all.
67  Using Arduino / Programming Questions / Re: Serial.print (TCCR1B, BIN); gives me nothing on: August 29, 2014, 02:35:37 pm
Code:
if (b < pow(2, i))
Using "pow" is a sledgehammer to miss a nut.
68  Using Arduino / Programming Questions / Re: #if defined(ARDUINO) && ARDUINO >= 100 on: August 29, 2014, 11:55:28 am
It's needed because early versions (pre 1.0) had a Serial method "print" which allowed binary when used with the qualifier BYTE, but this has now been superseded by the "write" method.
69  Using Arduino / Installation & Troubleshooting / MOVED: placa 2560 no funciona cuando desconecta la notebook on: August 29, 2014, 09:57:36 am
This topic has been moved to EspaƱol.

http://forum.arduino.cc/index.php?topic=263821.0
70  Using Arduino / Programming Questions / MOVED: Need help with some syntax on: August 29, 2014, 08:25:35 am
This topic has been moved to Interfacing w/ Software on the Computer .

http://forum.arduino.cc/index.php?topic=263804.0
71  Using Arduino / Project Guidance / Re: Clock on: August 29, 2014, 07:10:41 am
Quote
I just keep getting error codes
But you're not going to share them
Quote
too many to list in the one code
So, attach them.

Post your code.
Use code tags.
72  Using Arduino / Programming Questions / Re: Serial read more than 64 bytes? on: August 29, 2014, 04:21:15 am
Quote
This morning I got a sarcastic "Really?" from I guy I actually buy products from and give money to
Name and shame then, please.
73  Using Arduino / Programming Questions / Re: read string sent from java from serial port in arduino on: August 29, 2014, 04:17:57 am
Please post your code.
All of it.
74  Using Arduino / Programming Questions / Re: 'check' was not declared in this scope issue on: August 29, 2014, 02:53:13 am
You cannot put a function definition inside another function, at least not in this particular dialect of C/C++.
I'm surprised it compiles.
75  Using Arduino / Programming Questions / Re: Help with some coding issues on: August 29, 2014, 01:46:03 am
           Whilst
 you're              fixing
       the        code,
                                     do
           you             think
            you
  could    sort 
  out                      the
           indentation
using the auto-format tool?
Pages: 1 ... 3 4 [5] 6 7 ... 1898