Show Posts
Pages: 1 2 [3] 4 5 ... 142
31  Community / Website and Forum / Re: Forum Font on: July 16, 2014, 09:15:29 am
I get dodgy rendering too, the reference section is bad, the code examples are all missing the tops of letters.

@MadBob,
Google Chrome, Widescreen 1366 x 768
32  Using Arduino / Programming Questions / Re: #define, int or const int on: July 16, 2014, 09:10:25 am
Quote
They are both integer variables

Well, not really. Because a #define is a textual replacement, it is "typeless".

But its replaced value is not.
33  Using Arduino / Programming Questions / Re: HELP to Serial Transmission Please! on: July 16, 2014, 05:11:16 am
What hardware do you have ( RF )?

What library/driver do you plan on using?

Do you have more than two lines of code? If so can we see it?
34  Using Arduino / Programming Questions / Re: ECG sensor. PLEASE HELP HELP HELP HELP on: July 16, 2014, 03:40:38 am
What is the problem, is it supposed to do something else?

Is this the documentation for your ehealth thingo: http://www.cooking-hacks.com/documentation/tutorials/ehealth-biometric-sensor-platform-arduino-raspberry-pi-medical

We need more information, like what is it, whats connected to it, what you expect. From your picture it looks like its working???
35  Using Arduino / Programming Questions / Re: Priority of Interrupts on: July 15, 2014, 11:49:46 pm
An interrupt automatically has cli() called when it fires, preventing other interrupts from running.

To give one interrupt 'priority' you can re-enable interrupts inside the lower priority interrupt using sei(), however you can enter race conditions if an interrupt takes longer than you are expecting, and possibly prevent the normal program flow from resuming if the system is bogged down with an endless queue of interrupts. But done safely is fine, I have used this method successfully.

Otherwise an interrupt will be queued while another is executing.

https://www.youtube.com/watch?v=8beizVtMGrc
Here the rendering code used a timer interrupt to ensure a constant minimum frame rate, while the ADC is sampled using a lower priority interrupt. The main program flow was for long non-critical code. This method worked great.

36  Using Arduino / Programming Questions / Re: Fast DigitalWrite, made from Wire lib source on: July 15, 2014, 11:25:18 pm
In your code you remoived cli().

This is for larger processors ( Mega2560 ) which require two instructions to complete a pin change on registers outside the range of sbi/cbi.

If you have a compile time constant, you can have it omitted on smaller processors:

Code:
#ifdef __AVR_ATmega2560__
  const bool SafeMode = true;
#else
  const bool SafeMode = false;
#endif

//...
void dWriteF::Write(bool val){ 
 
  if (error1 == 100) return;  //EDIT,RETURNS just like library function
 
  uint8_t oldSREG;
 
  if( SafeMode ){
    oldSREG = SREG;
    cli();
  }


  if (val == LOW) {
    *out &= ~bitF;      // sends value using bitmask to register
  } else {               
    *out |= bitF;   
  }
 
  if( SafeMode ) SREG = oldSREG;
}

When safemode is false, the if's and oldSREG do not get compiled in. You could go one step further and ensure the address (out)  is above 0x5f before setting sreg, but is probably only efficient on a compile time pin numbers.

Also, 'inline' is only a hint the compiler can ignore. Use the GCC specific to force it inline if needed:
__attribute__((always_inline))
37  Using Arduino / Programming Questions / Re: Migrating from Arduino IDE -> Atmel Studio , "delay" hangs forever on: July 15, 2014, 11:10:21 pm
The reference has most, however things like init() are internal and most probably undocumented outside of the code.

http://arduino.cc/en/Reference/HomePage

You can also have  a look in the source, https://github.com/arduino/Arduino/tree/master/hardware/arduino/cores/arduino

Quote
although I bet the linker would have caught that.

Unfortunatly not, C++ allows function overloading. The code below compiles but is only 170 bytes compared to 450 with the built in init().
Lucky you didn't define your own.

Code:
void init(){}

void setup() {
 
}

void loop() {

}
38  Using Arduino / Programming Questions / Re: Convert Library on: July 15, 2014, 05:39:05 am
There is no library, but all the things the C# interface uses are available.

There are strtol, strtoul

A lot of the conversion functions are listed here: http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html
39  Using Arduino / Programming Questions / Re: need help please? on: July 15, 2014, 02:20:26 am
kevintutor, note the use of code tags below.
Quote this post to see the source or use the # button above the smileys to make a set of your own.
The tags keep code from being interpreted as html.

@op, these things:

[code=myfile.h]
  //Some code
[/code]

Produces:
Code: (myfile.h)
  //Some code
40  Using Arduino / Programming Questions / Re: Migrating from Arduino IDE -> Atmel Studio , "delay" hangs forever on: July 15, 2014, 12:25:03 am
Do you use int main()?

You will need to call init() or setup timer 0 yourself: http://arduino.land/FAQ/content/2/2/en/can-i-use-int-main-with-arduino.html
41  Using Arduino / Programming Questions / Re: limit on arays? on: July 14, 2014, 11:49:35 pm
yeah, RAM will be an issue long before the limits are reached.

However for a side reference, here is a link to info about the absolute maximums.
http://arduino.land/FAQ/content/6/7/en/what-is-the-maximum-number-of-elements-an-array-can-have.html
42  Using Arduino / Programming Questions / Re: convert string to int on: July 14, 2014, 09:36:32 am
so is there any way to do this?

You can access the internal string using the subscript operator, or the c_str method.

Code:
String s = "12345";

int num1 = atoi( &s[ 0 ] );

//Or

int num2 = atoi( s.c_str() );


The first method is useful if you need to start the conversion part way through the string ( or you could do c_str() + offset ).
43  Using Arduino / Programming Questions / Re: Fast DigitalWrite, made from Wire lib source on: July 14, 2014, 01:56:19 am
I use fat16libs code for many apps. http://forum.arduino.cc/index.php?topic=150325.0

It is around 25 times faster than digitalWrite.
44  Development / Other Software Development / Re: Upload contributions in the Arduino libraries on: July 14, 2014, 01:53:06 am
Log into github, go here: https://github.com/arduino/Arduino/tree/ide-1.5.x/libraries/Ethernet/src

Make your changes, then click save. Cos you do not have write permission github will automatically fork if needed, then put the commit in a new branch.

Then you can create a pull request.

When you work out the developers forum, a discussion there may support the pull request.
45  Using Arduino / Project Guidance / Re: Ethernet Webserver displaying images stores in byte arrays on: July 13, 2014, 08:40:28 pm
As Peter_n says, if you only have raw data, you can use HTML5

A combination of JavaScript to read the data, and a <canvas> element to draw into will do the trick.

Using JavaScript as a helper allows you to store the data in a hidden HTML element you send with the page, or it can even use an ajax request to get the data later.

There would almost certainly be a library here that will do what you want: http://www.cdnjs.com/ Very useful if the browser connecting to the Arduino can also access the internet.
Pages: 1 2 [3] 4 5 ... 142