Show Posts
Pages: 1 ... 20 21 [22] 23 24 ... 253
316  Development / Other Software Development / Re: SerialDataParser library on: July 31, 2014, 03:52:30 pm
Quote
SerialDataParser sdp('^', '$', ',');
Not to be nit-picky but why have the delimiter at the end instead of the middle?

I say this because when your sending an encapsulated packet of data, you first see the StartOfData character '^', followed but the delimiter(s) ',', and finally the EndOfData character '$'. So why not keep it in the same format?

Quote
^CMD,val 1,val 2,val 3$

One other thing, does your library know what data its receiving? Can it determine if your sending mixed type data(floats, int char), or does it just split the incoming data into parts and the user must specify what to do with those parts?
317  Using Arduino / Project Guidance / Re: Loop Management: doing two things at once on: July 31, 2014, 03:34:31 pm
Im not sure how you have your entire code structured, because snippets only show so much; but 99.9% of the time, you can replace a FOR loop with an IF/ELSE statement for a non-blocking approach.

If the rest of your code is non-blocking, then you don't need interrupts. Actually from what I see from your function, you don't even need the FOR loop. You could probably just have the IF/ELSE statements and just call the function to see what button is pressed.

There is another user Robin2 who has made a good example sketch that shows you how the code can do multiple things and still remain non-blocking. Look him up.

Edit: Ha, Robin already answered while I was typing this. smiley-lol
318  Using Arduino / Programming Questions / Re: 7 Segment Display Library on: July 31, 2014, 11:20:41 am
Question,
Why do this with your numbers, instead of making one function that accepts a byte value and using a simple FOR loop, do a bitRead of that value and send it out to the pins? You can put the pins in an array if needed.
Quote
void SegNumbers::one(){   // D=0 - C=0 - B=0 - A=1  --- SHOWS THE NUMBER 1

   // NUMBER 1 - 0001
   
   // ENABLE PIN
   digitalWrite(_en, HIGH);

   // SEGMENTS
   digitalWrite(_d, LOW);
   digitalWrite(_c, LOW);
   digitalWrite(_b, LOW);
   digitalWrite(_a, HIGH);

}

This is what I mean
Code:
void SegNumbers::Digit(byte value){ // D=0 - C=0 - B=0 - A=1  --- SHOWS THE NUMBER 1

// NUMBER 1 - 0001

// ENABLE PIN
digitalWrite(_en, HIGH);
       
        // _pins[0] = _a
        // _pins[1] = _b
        // _pins[2] = _c
        // _pins[3] = _d

// SEGMENTS
        for(byte i = 0; i < 4; i++)
    digitalWrite(_pins[ i ], bitRead(value, i ) );

}
319  Using Arduino / Programming Questions / Re: traffic lights on arduino atmega 256 on: July 31, 2014, 07:50:34 am
Nothing really happens all at once, but you can use a FOR loop to cycle through an array of all your pins and make them HIGH or LOW.

OR you can look into Direct Port Manipulation.
320  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 03:31:09 pm
Im an idiot, I see what your saying, yes, those are common anodes

I thought you were looking at the actual vertical wires.
321  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 03:28:12 pm
If your looking at my wiring diagram, all the pins at the top are common cathode, so all the RED LEDs in column 9 are tied together by their cathodes. Blue...Green...
322  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 03:19:29 pm






8x8x8 cube thread


323  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 03:11:56 pm
The link to CrossRoads 9x9x9 cube thread
324  Using Arduino / Project Guidance / Re: Have an issue trying to run two fans on a relay controlled by thermistor on: July 30, 2014, 02:46:20 pm
Its ok, it happens. Im glad to hear its working now.
325  Using Arduino / Programming Questions / Re: && help on: July 30, 2014, 02:41:36 pm
Quote
(now.minute == 19))
Should be
(now.minute() == 19))
326  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 02:38:06 pm
Yea, it would probably help if it was in color, but it is the best I could find.

Actually, I found it!
http://www.seeedstudio.com/wiki/images/thumb/d/de/8x8_RGB_Matrix_Schematic.png/500px-8x8_RGB_Matrix_Schematic.png
327  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 02:30:05 pm
Yes.
328  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 02:28:29 pm
Matrix wiring: http://www.logiccircuit.org/images/LEDMatrix0.jpg

This is the driver you can use if you don't want to get the individual chips:
http://www.dx.com/p/full-color-8-x-8-led-rgb-matrix-screen-driver-board-296126?tc=USD&gclid=COHjqLTi7b8CFSgV7Aods3oATg#.U9lHLPldWSo

*Note this only controls 64 LEDs, so two of these will be needed.
329  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 02:22:56 pm
The module was just an example to show the 64 LEDs. You can use individual LEDs, just make sure your wiring is correct.
330  Using Arduino / Project Guidance / Re: RGB LED Coffee Table on: July 30, 2014, 02:19:59 pm
Quote
Yes something like that but I was wondering if it had to be 8x8 or if I could do 6x10? Also It says I can use a max of 64 leds, how would I go about being able to use 128 leds?
A single driver (MAX7219 module) can control 64 LEDs, to add more, you need another chip and cascade the two, as done in the wiring diagram. ( See the yellow line going from the first driver to the second)
Pages: 1 ... 20 21 [22] 23 24 ... 253