Show Posts
Pages: 1 ... 279 280 [281] 282 283 ... 411
4201  Using Arduino / Project Guidance / Re: Why won't my Arduino light up? Pics of my project included on: December 05, 2011, 03:33:08 pm
1.  Does the Arduino power up when just the external power adapter is attached?  If not, it could indicate the polarity is reversed on the plug.

2.  Does the light work if you connect it directly to Vin and Gnd?

3.  What code you using?
4202  Using Arduino / Programming Questions / Re: Float addition oddity on: December 05, 2011, 03:01:40 pm
So you are saying that the integer part positions can occupy the floating point positions?
That's the definition of floating point.  The decimal point can "float" throughout the number, it doesn't matter which side of the decimal the significant figures happen to be on. 

I've not seen this kind of behavior before.
You probably have seen this behavior before and not realized.  On other platforms the floating point data type might be large enough that you didn't run into this "issue."
4203  Using Arduino / Programming Questions / Re: arduino shuts down.. serial overflow? on: December 05, 2011, 02:58:37 pm
So I am using the TVout library, though I'm not sure you need to know much about it to solve my problem. Basically the arduino program works for about 1 second then shuts off. Is this a serial overflow or something?
What do you mean by "shuts off"?  Does your program seem to stop running or does the Arduino board actually manage to power down?

Code:
   if (Serial.available ())
    {
    TV.draw_circle(Serial.read() - 6, Serial.read() - 6, 6, 1 ); 
You should really be checking that Serial.available() is greater than 0.  While syntax is correct, you should keep in mind that Serial.available returns the number of characters in the serial receive buffer.

As AWOL points out, you are calling Serial.read() twice.  Each call to Serial.read() removes 1 byte from the buffer.  So if there was only one byte in the buffer, the 2nd call to Serial.read() will result in -1.  

Either you meant to read 2 bytes in which case you could wait until (Serial.available() > 2), or you wanted to use the same byte twice in which case you should create a variable like char byteIncoming = Serial.read().


Code:
 Serial.flush();
There really is no reason to call Serial.flush().  And as of 1.0 flush actually flushes the transmit buffer, not the receive buffer.
4204  Using Arduino / Project Guidance / Re: Arm/Wrist band enclosures? on: December 05, 2011, 01:20:49 pm
An example of a custom wrist enclosure:
https://www.adafruit.com/products/495
4205  Using Arduino / Installation & Troubleshooting / Re: String += not working on: December 05, 2011, 11:55:35 am
If you look at WString.cpp in the Arduino core files, you will see that concatenation using += is implemented as concatenation.   

It works by allocating a buffer large enough to contain the old + new string, then cating it.  This appears to lead to memory fragmentation on ATmegas limited memory and stack environment.

Your workaround works or just treating all Strings as character arrays instead.  This results in much lower over head.  It does require you, as the programmer, to determine ahead of time what size the arrays should be.  Which, in such a limited memory environment, is actually a good idea.
4206  Using Arduino / Programming Questions / Re: unknown IR receiver error on: December 05, 2011, 11:45:09 am
Code:
if (results.value == "16662719") {
      digitalWrite(13, HIGH);
    }

The complier is actually telling you the exact problem.  Without looking at the library, this must mean that results.value is an integer.  "16662719" is a character string.  The complier can't compare the integer (results.value) to the pointer which points to the start of the constant "16662719".

You probably meant:  16662719 which is a number instead of a string.

Now, 16662719 is too large for an int.  So you should actually write it as:

Code:
if (results.value == 16662719UL) {

This will compare the unsigned long of results.value with the unsigned long 16662719.
4207  Using Arduino / Project Guidance / Re: Nunchuck SoftI2C for Arduino Uno on: December 05, 2011, 11:33:06 am
Hopefully you didn't just sigh at my subject title, but I am wondering if it was possible to modify todbot's softI2C code ( http://todbot.com/blog/2010/09/25/softi2cmaster-add-i2c-to-any-arduino-pins/ )

Well I don't think you would modify the softI2C code.  Instead you need to modify the Wii library to use the softI2C, which should be possible.
4208  Using Arduino / Project Guidance / Re: Nunchuck SoftI2C for Arduino Uno on: December 05, 2011, 11:31:08 am
I think im in the same boat as you.
Except that your issue has nothing to do with what the original poster is asking about.

just haveing trouble getting it to load the error i get is
 "call of overloaded'write(int)' is ambiguous"

im running an Arduino uno with 1.0 programing software
1.0 represents a large number of changes to internal libraries such as the Wire library, which this WiiChuckClass is based on.  If you don't know how to update it yourself, I would suggest dropping back down to 0023 until this class gets updated.
4209  Using Arduino / General Electronics / Re: PS1 Controller Questions on: December 04, 2011, 10:01:44 pm
So I think PS1 controllers and PS2 controllers have no difference, really. Am I wrong?
The protocol (SPI) is the same.  PS2 supported analog sensitive buttons which PS1 did not.

Bill's library won't upload. Some error about not in sync.
What error about being "not in sync."  The error you posted indicates a syntax problem in one of the header files.
4210  Using Arduino / General Electronics / Re: PS1 Controller Questions on: December 04, 2011, 09:44:59 pm
This library found on that site doesn't work. I'm running 0022 or 1.0 of the ide, and both say it has an error compiling.

Based on this error you need to.... err.. wait.  What's the error?
4211  Using Arduino / Programming Questions / Re: how to use if statement on: December 04, 2011, 08:59:11 pm
From the reference:
Code:
map(value, fromLow, fromHigh, toLow, toHigh)

After re-reading your code, this doesn't make sense:
Code:
pinkyflex =map(pinkyflex, 722, 880, 6, 179);
  if (pinkyflex > 725) {

If pinkyflex is 722, then it becomes 6.  So pinkyflex isn't going to be greater than 179 when your if-statement executes.  A Serial.print() statement right before the if-statement would have illustrated that.

4212  Development / Other Software Development / Re: Arduino-1.0 Serial.flush() on: December 04, 2011, 08:52:38 pm
It's just poor design to let it be done this way. Ultimately, it's these kind of compromises that will make Arduino get even slower than it already is.
I completely fail to see how this change makes anything slower.

Quote
Second, there are very few legitimate uses of the flush function.
At a user sketch level its totally valid. If you have a particularly verbose module, it can be constant spewing stuff into the serial port. If you are only interested in query-response, then you would want to be able to flush the serial buffer.
You say it is valid and then propose a completely invalid situation.  If you really feel the need to flush the serial buffer so that you only see the "response" you are interested in, you have to write your own flush method anyway.  You would need to flush everything except for tokens that you want to see.

If on the other hand you want to just dump whatever is in the Serial Receive buffer, a simple for loop will do that.  Re-purposing flush to the transmit makes sense now that the transmit buffer is asynchronous.
4213  Using Arduino / Programming Questions / Re: how to use if statement on: December 04, 2011, 08:38:15 pm
If I use the code below the values of 722 and 880 work fine. 
Absolutely no idea what "work fine" means.  Describe the behavior you are seeing and the behavior you don't want to see.
4214  Using Arduino / Project Guidance / Re: Adding more and more to the 5v on the arduino on: December 04, 2011, 08:37:13 pm
i know about 7805 and LM317, but i guess other solutions would be better) and also i would run the 12v directly to the relays..
Keep in mind that linear regulators generate heat and (generally) have built-in thermal protection.  If you don't have a heat sink, their max output current is limited.

its not a problem to have two paralell 5v powersupplies that powers microchips that have signal wires connected together ...?
The problem is if you tie the 5V output of multiple regulators directly.  Powering multiple devices from different 5V supplies is perfectly normal.  As long as all Ground (GND) connections are tied together.
4215  Using Arduino / Microcontrollers / Re: Q: about the NEW Uno R3- and it's LP2985 on: December 04, 2011, 08:27:06 pm
I know in the old days when the Arduino used the FTDI chip, it's internal 3.3v regulator could only supply 50 mA. But that's why they put on the board the 3.3V LP2985 regulator.

One school of thought was that the 50mA specification was used so that shields using 3V3 will remain compatible with pre-Uno boards. 

I've done some minor tests, with resistors, and have been able to get draw 100mA from the LP2985 on the Uno.
Pages: 1 ... 279 280 [281] 282 283 ... 411