Loading...
Pages: 1 ... 7 8 [9] 10
 81 
 on: Today at 02:38:08 pm 
Started by pYro_65 - Last post by obiwanjacobi
How do you know that you are not writing past your array bounds?
From what I can see the GString class does not do any bounds checking.
I also do not get the use of template parameter T. Could you not have used void* and cast that to uint8_t? And why not use char? Each template method generates extra code that has little/no? use.

I also do not like the Print class but I can understand why you would want to stick with that. I rewrote the Print class to a template class (TextWriter). That class implements only the knowledge on how to convert a value to text, nothing else. The Print class does that also but my TextWriter does not take up any permanent RAM bytes (Print class has virtuals/v-table and an int member) at the cost of generating more code (being a template class).

Writing a string class, you would have to give considerable thought to how you would want to manage the memory it takes to store those strings. Especially with concatenation of string. I would make a distinction between operations that work on the string itself (like toUpper) and functions that produce new strings. The latter type I would make static to drive the point home that you are creating a new string - that needs new memory. I would make the methods robust enough so you could use one parameter as the result also (copy into itself). I would
Would also be nice to encapsulate the PRGMEM strings.

Something like:

Code:
String(char* buffer, unsigned int capacity);
unsigned int getCapacity();
unsigned int getLength();
char GetCharAt(int index);
bool SetCharAt(int index, char value);
bool InsertCharAt(int index, char value);
const char* operator();

// base can be same as result - provided capacity is enough
static bool Concat(String& base, String& tail, String& result);
static bool Concat(String& base, String& mid, String& tail, String& result);

static String& Empty();

I would keep the class very lean (like you have done). I would perhaps make a different class to find things in strings (StringReader?). FindFirst, FindLast, IsDigit, SubString (could go both ways) and the likes.

Hope it helps.

 82 
 on: Today at 02:38:04 pm 
Started by Snakebitx1 - Last post by CrossRoads
What's a "Sanguinololu 1.3"?
How'd you get it to appear in the Board list?
What is Sprinter?

Did you try a loopback test to see if the FTDI chip is working?
http://forum.arduino.cc/index.php?topic=73748.0

 83 
 on: Today at 02:34:55 pm 
Started by Nicknml - Last post by Nicknml
Quote
t lists a max gate threshold voltage of 2.5 volts, so the 5 volt output of an Arduino pin should be more than enough voltage to saturate the MOSFET if I understand correctly.
No the gate threshold is the point where the FET just starts to turn on. What you need to look at is the voltage quoted when the resistance from drain to source is quoted. That is the voltage you need to supply to the gate.

Ok thanks, I see 4.5 volts and 10 volts listed with a drain current of 37.5 amps (with lower resistance at 10 volts), so could I get away with using 5 volts?

 84 
 on: Today at 02:33:59 pm 
Started by dante198880207 - Last post by dante198880207
@robtillaart where is the
Quote
i need to do pwm nad make the random signal sinusoidal.
bit?
pseudo random bit sequence i think.

 85 
 on: Today at 02:33:42 pm 
Started by ironheartbj18 - Last post by Runaway Pancake
So, supply a HIGH to the layer to enable it and then turn the LEDs on with a LOW instead?


 86 
 on: Today at 02:33:39 pm 
Started by mark7w - Last post by AWOL
Code:
char * apples[5] = {"red","green","green","red","green"};
Code:
apples[a] == "red"
Not a great example.

 87 
 on: Today at 02:32:15 pm 
Started by arduinoPi - Last post by majenko
Did you think to look in the data sheet ...?

The device has 3 power pins - "VDDM" is the main power supply for powering the chip.  This is 3.3V.  Then there is "VCC1" and "VCC2" - these are the power supply pins for the two halves (0-7 / 8-15 respectively) of the IO pins.  Connecting 2V to VCC1 will cause IO pins 0 thru 7 to use 2V for their HIGH value.  Applying 3V to VCC2 will cause IO pins 8 thru 15 to use 3V for their HIGH value.  The input thresholds are relative to that same VCCx voltage

 88 
 on: Today at 02:31:31 pm 
Started by Federico_Paiano - Last post by gpb01
... Astrociop ...
... Astrosbin ...

Guarda, Astrobeed non ha certo bisogno del mio intervento, ma per correttezza e per rispetto verso una persona di cui ho la massima stima, ti pregerei di evitare di fare "dello spirito" con "nomignoli" del genere.

Potresti spendere meglio il tuo tempo leggendoti un po i vari interventi del forum e guardado quale è il contributo di Astro in tutte le discussioni.

Guglielmo

 89 
 on: Today at 02:30:55 pm 
Started by loudboy - Last post by permnoob
peter is smart! do you have a spare battery lying around?  with the whole thing installed on your bike, but wired to the spare battery sitting on the floor, startup your bike and see if the issue survives.  then you know if its radiated noise or electrical noise quick and easy

 90 
 on: Today at 02:30:34 pm 
Started by minitreintje - Last post by minitreintje
Thank you for the fast reply.
I will try it now. It works! THANK YOU :p


regards,
minitreintje

Pages: 1 ... 7 8 [9] 10