Show Posts
Pages: 1 ... 51 52 [53] 54 55 ... 150
781  Community / Website and Forum / Can anyone else verify this font size shrinking problem? on: December 29, 2013, 06:53:23 am
http://forum.arduino.cc/index.php/topic,95914.0.html

At the start of the page, post text is 15px in size, which slowly shrinks down to 9px in size.
782  Using Arduino / Programming Questions / Re: String "Limiter" function on: December 29, 2013, 03:37:48 am
It is easy to add that functionality in by deriving the string class, however, I do not understand your example:

Quote
string= "1234567890abc"
out=string.limiter(0,4) ;    //start, stop

result: out="90abc"

'9' is neither the 'zero'th' character from either end of the string, nor is 'c' the fourth, maybe the 4 is a length? Can you explain what your wanted function is actually doing?
783  Community / Website and Forum / Re: Identify OPs posts within a thread - different colour, perhaps? on: December 28, 2013, 07:33:56 pm
I agree with this idea. I however would opt for the entire background of all the thread starters post's be a different colour, not heavy, just a shade of colour.
784  Using Arduino / Programming Questions / Re: Creating a struct from an initializer list on: December 27, 2013, 07:27:51 am
That isn't an initialization, it is an assignment as the object is already initialized. Also the solution is not a cast, rather a 'Compound literal'

Usually, the specified type is a structure. Assume that struct foo and structure are declared as shown:

     struct foo {int a; char b[2];} structure;
Here is an example of constructing a struct foo with a compound literal:

     structure = ((struct foo) {x + y, 'a', 0});
This is equivalent to writing the following:

     {
       struct foo temp = {x + y, 'a', 0};
       structure = temp;
     }
785  Using Arduino / Programming Questions / Re: Alternative serial monitor on: December 27, 2013, 12:49:40 am
The best monitor I have used is called Hterm. It is by far the most feature full monitor I have used ( far better than many paid alternatives ).

Here is a thread I started a while ago asking a similar question. Hterm was recommended there.
Free serial monitor / serial data capture applications. Recommendations?
786  Topics / Home Automation and Networked Objects / Re: router on: December 24, 2013, 09:21:50 pm
I have used this method for a while, its a nice and cheap alternative. Also very stable compared to the official Wifi shield as that does not properly support transport protocols and fails easily.

I have also wanted to try a router with multiple ports. Using an Ethernet to USB adapter ( for networked USB ) I'm hoping to be able to upload sketches remotely via Ethernet. Got my hands on an old goat (DSL-G604T) to test in the new year.
787  Development / Other Software Development / Re: Best way to determine CPU type at compile time? on: December 24, 2013, 08:49:53 pm
This is how I do it in one of my multi-platform libs ( the AVR section anyway ), I think fat16lib did the hard work of gathering up all the processor defines.

This is what it can detect now.
* ATmega
  - 32u4
  - 168
  - 168p
  - 328p
  - 644
  - 644p       
  - 1280
  - 1284p       
  - 2560

* AT90USB
  - 646
  - 1286

Code:
// 168 and 328 Arduinos
#if defined(__AVR_ATmega168__) ||defined(__AVR_ATmega168P__) ||defined(__AVR_ATmega328P__)
  #define CHIPSET ATmega_168_168P_328P
 
// Mega 1280 & 2560
#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
  #define CHIPSET ATmega_1280_2560
 
// Sanguino
#elif defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)
  #define CHIPSET ATmega_644_644P_1284P
 
#elif defined(__AVR_ATmega32U4__)

  // Teensy 2.0
  #ifdef CORE_TEENSY
#define CHIPSET ATmega_32U4_A

  // Teensy
  #else
#define CHIPSET ATmega_32U4_B
  #endif
 
// Teensy++ 1.0 & 2.0
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
  #define CHIPSET AT90USB_646_1286
#endif

#include   INCLUDE_FILE_3(HARDWARE_PREFIX,GENX_PLATFORM,MAKE_DIR(CHIPSET),.pins)

You can remove the CHIPSET define and the file include, then fill in with your own design.
788  Using Arduino / Programming Questions / Re: Nesting vs Flow on: December 24, 2013, 02:08:28 am
Exceptions are actually quite the opposite. They provide a safe mechanism to recover from an error/loss of state by unwinding the stack ...

Unwinding the stack, and killing the stack, seem the same to me (in a sense). You are discarding stack entries.

Its not discarding it at all. The purpose of stack unwinding is to call the destructors of the objects that reside in the stack, allowing them to finish and free their memory and so on.
789  Using Arduino / Programming Questions / Re: variables global,local,static and constants on: December 24, 2013, 01:49:20 am
What pYro_65 said shouldn't been trivialized.

What exactly are you referring to?
Static locals have the same scope as auto locals, the benefit is persistence.
File scope/member static variables are limited to the scope they are defined in.
Also local statics have no implication on code size, how it is used determines the potential for optimization.
790  Using Arduino / Programming Questions / Re: Nesting vs Flow on: December 24, 2013, 01:40:26 am
Quite simply, you almost never need to do this. There are ways, exceptions is one of them (not available on the Arduino) and also non-local goto, however I recommend the state machine.

Exceptions are actually quite the opposite. They provide a safe mechanism to recover from an error/loss of state by unwinding the stack to the point of the first encountered exception handler. If it can resolve the error, the stack is intact and ready to go. If it cannot, the exception is re-thrown and the unwinding continues to the next handler.
791  Community / Bar Sport / Re: Can you actually buy these anywhere?? on: December 24, 2013, 01:27:50 am
Rarities... Arduino UNO R3 ATmega328P: $113.75 in eBay. Seems to be the OEM.

It clearly says its a clone, its just a claim to high quality.  It is a mistake, if you look at the previously sold list they went for $13.75

http://www.ebay.com/itm/UNO-R3-ATmega328P-ATmega16U2-Free-Cable-for-Arduino-FAST-US-QUALITY-SHIP-/181233924280?pt=LH_DefaultDomain_0&hash=item2a326238b8
792  Using Arduino / Programming Questions / Re: variables global,local,static and constants on: December 24, 2013, 12:38:49 am
Either variable is subject to optimization.

If the compiler can see that nothing writes to them it may evaporate into load data commands and use no ram at all.
The compiler can do the least with it if you take a reference/pointer that the compiler cannot follow; something like an array of pointers where the index used to access it may come from an external/interrupt source ( analogRead, switch,... ).

The compiler doesn't need "const" to optimize out things that are blatantly obvious either. Infact sometimes you have to use "volatile" to stop it from doing so.

EDIT: Globals have lots of things that can cause nasty headaches, if only one function/scope needs the persistent data then go for the local static.
793  Using Arduino / Programming Questions / Re: Nesting vs Flow on: December 24, 2013, 12:26:36 am
The stack space is used for this, each function call is "pushed" onto the stack, when it returns it is "popped" from the stack.
As the callee of a called function hasn't returned its data is still on the stack.

So the memory position ( in the stack ) before a function is the stack space for the function that called it, this may include saved register states between calls.

The stack actually starts at the end of RAM and grows backwards, just switch the meanings of before and after and you're fine smiley

The recursion limit is based on memory exhaustion, AVR's have the bonus of not having program space in ram so you can recursively call small functions many times before a considerable amount of memory is  used.
794  Community / Bar Sport / Re: Can you actually buy these anywhere?? on: December 24, 2013, 12:11:13 am
You've made  no mention of the price you wish to pay. Do you mean New York when you say big apple? If so I do not really believe that New York only has one reasonably priced retailer.

What about Ebay?
Whats wrong with these knock offs:
  • Pro Mini $2.95
  • Uno $5.99

    The board may be of a lesser quality ( quite good in my  experience ), but the processor is still made by Atmel.
795  Using Arduino / Programming Questions / Re: variables global,local,static and constants on: December 23, 2013, 11:26:29 pm
Using a static variable in a function has no different implications to a global variable ( to the function with the static var ). Everything else however will either not see the variable, or have access to it, depending on weather its static or global respectively.
Pages: 1 ... 51 52 [53] 54 55 ... 150