Show Posts
Pages: 1 ... 52 53 [54] 55 56 ... 152
796  Development / Other Software Development / Re: Sublime Text and Stino: Best IDE you can have. on: January 01, 2014, 05:49:53 am
Your last item is flagged as an unsafe page (http://kaixin.netii.net/stino-a-sublime-text-2-plugin-for-arduino.html#comment-16) .
Both VirusTotal and Comodo flagged it.
797  Using Arduino / Programming Questions / Re: |= and += on: January 01, 2014, 03:32:29 am
Addition is slightly different to or. Its no different to using chars, registers are just values too.

6 | 2 = 6
6 + 2 = 8

If you do not know what the operators are:
http://www.cplusplus.com/doc/tutorial/operators/#bitwise
http://www.cplusplus.com/doc/tutorial/operators/#logical
798  Using Arduino / Installation & Troubleshooting / Re: Kernel Panic while using the Arduino IDE on: January 01, 2014, 12:01:59 am
Does mac have a safe zone or sandbox you could run it in. Not ideal but might stop crashing the whole computer, and maybe give a clearer hint as to what is happening.

Do you get any error messages before the computer crashes?
Look at the system event log. Power failures might appear when the CPU usage spikes and draws more current. I'm not a mac owner so I can't give any solid advice, however there is a very good chance this has happened to someone else. Google up a storm, might even be worth looking for fatal java errors on mac.
799  Using Arduino / Programming Questions / Re: Where does __SREG__ get defined? on: December 31, 2013, 11:37:25 pm
Can you make a pointer to use.

As SREG is just a number literal, maybe you just need a place holder, which is what I assume __SREG__ is.

Code:
uint8_t *u =( uint8_t* )  0x3F;

or

Code:
uint8_t &u = *( uint8_t* )  0x3F;

but it may be a linker generated value like __brkval and __heap_start
800  Using Arduino / Programming Questions / Re: Where does __SREG__ get defined? on: December 31, 2013, 09:31:44 pm
it is simply a memory location.

Code:
/* Status Register */
#ifndef SREG
#  if __AVR_ARCH__ >= 100
#    define SREG _SFR_MEM8(0x3F)
#  else
#    define SREG _SFR_IO8(0x3F)
#  endif
#endif

Found in D:\arduino-1.0.5\hardware\tools\avr\avr\include\avr\boot.h

Can't find a define for __SREG__ yet, but it would be the same memory location.
801  Using Arduino / Programming Questions / Re: String "Limiter" function on: December 31, 2013, 09:09:32 am
Happy new year,

here is a JQuery inspired design alowing a simple?? syntax like: s.find( '/' ).find( '/', 1 ).next().print( Serial );.
It is an excerpt from a new lib of mine, uncreatively named CQuery

Code:
struct Str{
  Str( char* _s ) : s( _s ){}
  
  operator char*() { return this->s; }
  
  Str find( char c, int offset = 0x00 ){
    for( unsigned i = offset ; s[ i ] ; ++i ) if( c == s[ i ] ) return Str( s + i );
    return Str( this->s );
  }
  
  void print( Print &p ) { p.print( s ); }
  Str next( void ) { return Str( ++s ); }
  char *s;
};

void setup() {

  char c[] = "31/12/2013";
  Str s = c;

  Serial.begin( 9600 );
  
  s.find( '/' ).find( '/', 1 ).next().print( Serial );
}

void loop() {}
Returns 2013

I have been designing it for an HTTP server which has to parse responses.
802  Using Arduino / Programming Questions / Re: String "Limiter" function on: December 31, 2013, 08:04:14 am
Here is a happy fun C++ design:

Code:
template< typename T, unsigned N >
  unsigned int InArray( T (&t)[ N ], const T &f, unsigned z = 0x00 )
    {
      for( unsigned i = z ; i < N ; ++i ) if( f == t[ i ] ) return i;
    }

void setup() {
  Serial.begin( 9600 );
  
  char c[] = "31/12/2013";
  char s ='/';
  
  Serial.print( &c[ InArray( c, s, InArray( c, s ) + 1 ) + 1 ] );
}

void loop() {}
803  Using Arduino / Programming Questions / Re: ProgMem store Unsigned Long data on: December 31, 2013, 01:15:06 am
Didn't see your setup(), unsigned longs are 4 bytes, you read only one.

DEC: 11111
BIN: 10101101100111

the highlighted part as a single byte is 103

use pgm_read_dword()
http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html
804  Using Arduino / Programming Questions / Re: ProgMem store Unsigned Long data on: December 30, 2013, 11:29:35 pm
make the integer literal ( the number ) an unsigned long using a type suffix.
Quote
unsigned long mydata[] PROGMEM =
{
0,
11111UL,
2,
3,
4,
5,
6,
7,
8,
9
};

You can do the same with floats and others:
Quote
float f = 123.456F;
int i = 0xAABB; //Not needed
unsigned long long u = 0x1A7EBADF00DULL;

u requires the 'ULL' as the integer literal will be taken as a 32-bit or long.
805  Using Arduino / Programming Questions / Re: Syntax Help on: December 30, 2013, 03:47:46 am
Below shows a class declaration with a function declaration. Below that is the function definition for the declaration. The class name is used in conjunction with the scope operator '::' to form the function definition. Without it the function would be an ordinary non-member function.

Code:
//In a header file
struct Imon_INA220{
 
  void wireReadRegister( uint8_t reg, uint16_t *value );
};

//...In a cpp file somewhere
void Imon_INA220::wireReadRegister(uint8_t reg, uint16_t *value)
  {
    //...
    return;
  }
806  Using Arduino / General Electronics / Re: Rabbit killer on: December 30, 2013, 01:55:57 am
Buy/inspect a cheap fly zapper, then just use more powerful components. Will see if I can get a photo of mine.
807  Community / Website and Forum / Re: Can anyone else verify this font size shrinking problem? on: December 30, 2013, 12:46:54 am
Its not a bb tag causing the problem. His signature has been truncated leaving a half finished piece of HTML, also robtillaart is right, everything below inherits the styles of the unclosed element, the link I posted is so dramatic because he posts like 6 times on the one page.

This is what will happen to many other signatures including mine if they truncate them all to 150 chars.

146 chars for this sig:
Quote
<a rel="license" href="http://creativecommons.org/licenses/by-nc-

sa/3.0/"><img alt="Creative Commons License" style="border-

width:0" src="ht</div>

As my browser shows, the sigs are normally smaller in font size, and the highlight above shows the closing div for the signature in a string, so it is skipped. Each time the dude posts, the text is lowered that little bit more.

As a website owner myself I can see that this is a terrible position to be in. For example one could exploit the shortened signature to inject a Javascript causing everyone to give false karma to the attacker, not to mention wreak absoulte havoc on the site using reputable logins
808  Community / Website and Forum / Re: Can anyone else verify this font size shrinking problem? on: December 29, 2013, 07:04:24 am
Found the problem anyway, it is this guys signature that messes the page up & all others with posts on it.
http://forum.arduino.cc/index.php?action=profile;u=28809

I would say it is down to the test being done on signature lengths, and has been truncated.
809  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.
810  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?
Pages: 1 ... 52 53 [54] 55 56 ... 152