Show Posts
Pages: 1 ... 42 43 [44] 45 46 ... 94
646  Using Arduino / Programming Questions / Re: Arduino Uno zero crossing strange behavior on: November 11, 2013, 11:20:29 am
Do not do delays in an interrupt!
If the zero crossing occurs, set a global flag and get out.
Use loop() to toggle the LED.
647  Using Arduino / General Electronics / Re: Why are the maximum ratings in negative volts? on: November 11, 2013, 10:39:21 am
Because it is a PNP and the base is the reference (ground) terminal.

If you reverse the polarity, you will forward bias the junction and get a small voltage.
648  Using Arduino / General Electronics / Re: Can you stack, or daisy chain many transformers for high voltage? on: November 11, 2013, 10:37:39 am
fungus, we will assume that that was a typo.
649  Using Arduino / General Electronics / Re: Can you stack, or daisy chain many transformers for high voltage? on: November 11, 2013, 10:15:42 am
To *really* impress the girls you need a Z-Machine:
http://www.sandia.gov/z-machine/
650  Using Arduino / Programming Questions / Re: Can Arduino handle 8 bit ASCII? on: November 07, 2013, 07:10:57 pm
Quote
8 is not a valid octal digit.

It was in the first versions of C descibed in K&R1!

9 was, too. ANSI straightened that out.
651  Using Arduino / Programming Questions / Re: Code Question on: November 07, 2013, 07:07:53 pm
Quote
Oh yes, that reminds me, some people seem to think that "return" in C needs
parentheses, when it doesn't...   

sizeof doesn't either in some contexts.
652  Using Arduino / Programming Questions / Re: Can Arduino handle 8 bit ASCII? on: November 07, 2013, 02:53:39 pm
The proper form for numeric escapes is
Code:
b= '\224'; // octal!
or
Code:
b = '\x94'; // hex

but you are limited to 3 octal digits in the first case.

Values "outside the range of unsigned char" are not permitted.

but, as Harbison and Steele state: "the syntax for numeric escapes is delicate".
653  Using Arduino / Programming Questions / Re: Code Question on: November 07, 2013, 02:43:10 pm
Also note that ^ is bitwise, so it only works on the LSB of ON_STATE.
654  Using Arduino / Project Guidance / Re: Help needed ASAP to detect rounded rectangle using C sharp on: November 07, 2013, 02:41:12 pm
There was an article in October's IEEE spectrum about a guy who used open source tools to use a webcam to capture data from his weather station. It might help:
http://spectrum.ieee.org/geek-life/hands-on/diy-data-capture-via-web-cam

But isn't the point about barcodes that you *don't* need to directly identify the area?
655  Using Arduino / Programming Questions / Re: what different that's code >.< on: November 07, 2013, 12:53:06 pm
As nid69ita points out your syntax is broken.

However, I think the answer to your question is that initializations need to be constants known at compile time.

Since the #define in point 1 is just textual substitution it will work.

The other in point 2 is a standard variable. (You haven't provided enough context to tell if it is static or automatic.) The initialization happens at run time, so the variable is considered empty at compile time, so you can't use it to initialize another variable.
656  Using Arduino / Programming Questions / Re: Fill with zeros a number? on: November 06, 2013, 06:44:45 pm
I don't know if the Arduino supports it, but you can use a '*' to signify a runtime parameter:
http://c-faq.com/stdio/printfvwid.html
657  Using Arduino / Project Guidance / Re: Random Number Generator Project on: November 06, 2013, 06:39:23 pm
I like these, you simply send them a serial command:
https://www.sparkfun.com/products/11442
658  Using Arduino / Installation & Troubleshooting / Re: Internal compiler error on: November 06, 2013, 04:09:20 pm
Show us the code. It is possible, but unlikely!, that you have found a bug in gcc.

Can you compile the "Hello World" example?
659  Using Arduino / Programming Questions / Re: Arduino Loader only on: November 06, 2013, 03:44:29 pm
Just send them the HEX file and use AVR-dude.
660  Using Arduino / Programming Questions / Re: Fill with zeros a number? on: November 06, 2013, 01:06:31 pm
http://www.cplusplus.com/reference/cstdio/printf/

Warning: The arduino does not support all the type specifiers, specifically floating point %f and %g.
Pages: 1 ... 42 43 [44] 45 46 ... 94