Show Posts
Pages: 1 [2] 3
16  Using Arduino / Project Guidance / Is wifi really the only way to send wireless data from iPhone to arduino? on: October 13, 2012, 07:57:42 pm
Android -> Bluetooth -> Arduino -----> Success!
iPhone -> hoops -> hurdles -> puking?

I have read that there is no way (without becoming a hardware manufacturer and getting approved) to send bluetooth data from your every day iPhone? Can anyone definitively tell me that wifi is the only way to make a project that should wirelessly receive input from an iPhone?

What we are talking about here is R,G,B values for a lighting controller.
17  Using Arduino / General Electronics / Logic level mosfets do not turn on, unless I touch them! on: October 13, 2012, 07:52:35 pm
Following the example by lady ada here:
Using the STP16NF06 as suggested, wired properly, with a TLC 5940 driving them commanded by an arduino, nothing happens unless I hold the PCB in my hands. simply touching the pins of the mosfets, while a fade is running, turns them on until the fade completes (I can let go as soon as everything lights up). The RGB LED's stay dark until I touch the mosfets with dry, bare hands again. NOTE, I did not install the 10k resistors (yet) that I have seen in other depictions, but aren't those to make the mosfets turn back off? My current limiting resistor (IREF) on the TLC5940 is a 2.2k.
18  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 11, 2012, 03:47:33 pm
Got rid of that ugly math, thanks guys, and sortData() is a result of complaints about invalid Char to int conversions. data[chan][0] = atoi(red); doesn't work.
19  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 11, 2012, 01:55:48 pm
they are the output pins of the TLC5940
Red, Green, and Blue
channel 0 is ouptuts 0,1,2
channel 1 is outputs 3,4,5
channel 2 is outputs 6,7,8
channel 3 is outputs 9,10,11
channel 4 is outputs 12,13,14


181. {
182. case 0:
183. r = 0; // 0
184. g = r++; // 1
185. b = g++; // 2
186. break; // I'll admit, I thought the increments looked a lot cooler than r=0, g=1, b=2 (yes, I am a bit immature)
187. case 1:
188. r = 3; // I know you really like tables, matrices, 2d arrays; but, I am sure 100% sure that looking these simple values up like
189. g = r++; // that would be slower than this, even if there is a better way than this...
190. b = g++;
191. break;
20  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 11, 2012, 01:02:18 pm

I have updated the code to remove the repitition, still haven't finished saving, or all of the modes. I will be goign through and adding in the suggestions I have gotten later this evening or tomorrow(back and forth between this and the android app).
Maybe you could post the design files if they are in a format some of us have.
I have Eagle, and gerbers, but these are not images, my server has no domain, and it would be an abuse of my corporate hosting account to put anything personal up. How do you suggest sharing my files?
21  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 10, 2012, 07:04:20 pm
Memory is not the issue, speed is. Without missing any incoming serial data, I want the loop to run as many times per second as possible, so that if the audio mode is in use, no audio events will be missed. That is to say, If the user has "bass" selected for response, I don't want the code to miss an incoming peak corresponding to "bass" resulting in a delayed or missing "pulse" to the music. The simple setting for just choosing a color to display, won't have this problem, but the "color organ" functionality is time sensitive in relation to whatever happens to be playing at the moment.
and can you please unindent your { and } lines one level?
No, I'm so used to HTML that this is the structure I am used to seeing, and makes it easier for me to read my own code... Even my java looks like that...
Oh, and you're going to stop using String, aren't you?
I don't have to take serial data as String?
Here it would be prudent to do a bounds check before appending to the array, just in case.
From here on out, it is obvious to me that you are a much more advanced C++ programmer than myself. I have no idea what a bounds check is...
Also, wouldn't it be best to reset serialIn to zero and re-terminate the buffer every time you get a StartOfPacket character?
Yes, yes it would. Thank you!
I'd parse each message directly into an int array instead of building arrays of char * and cut out all that horribly repetitive chanxsort() stuff. If you parse and validate the channel field first, you can chuck the remaining fields directly into the relevant chanx array. I'd much prefer to see those stored in an array of arrays. In general, when you find yourself appending numbers to variable names, you should be looking for ways to put them in an array and consolidate the processing into common code.
In any case, do you really need map() here? All you need is rojo = 4095 - rojo.
YES! THANK YOU! I never thought of doing it that way in all the nights of lying in bed, staring at the ceiling, coding in my head and wondering about another way to invert those values...
This code above that seems to be defining fading implies some code to detect an end time which will not deal correctly with timer overflow. Maybe you don't expect this to be kept powered up for the month or so it will take for that to happen, and I don't even know whether tlc_addFade() is your code, but make a mental note that this is not a good way to specify a time for things that are intended to happen in the future.
The original purpose of this lighting controller was a car underglow controller, it has grown to much more than that now, and so would need to be reset because of overflow when used indoors. Most of my target market is kids with civics, and they won't idle for a month... So battery or gas, the boards will get reset. Tlc_addFade is a part of the TLC5940 Library on google code and is the recommended method of using a TLC5940 with an arduino. Maybe something else you guys can help with. I passed DRC with my boards I sent to Seeedstudio's fusion PCB service, but after 10 days the sent me today, "Sorry, the lines are too clutter, could you please correct it and resend to ." They included the top layers of my board as an image.
22  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 10, 2012, 04:46:13 pm
Okay using a matrix (that is what we are talking about here? or is a vector a different kind of 2d array?), I see how to use it as a table and store the data for each channel in it, modifying the address based on channel. So from there, reading the data off to output it, I don't see a way to replace doChan<NUM>() with doChan(), the way I will sortData(), but then again shortening sortData() to a single function will slim my code a bit. The biggest thing I am worried about, and why I am looking to shorten the code, is speed. I don't care if my code is ugly (just being honest!) But some songs are 200bpm! In audio mode, I figure if I can get the whole loop to run greater than 1000 times/sec, I will never miss an audio pulse. I realize a serial counter would slow down that figure, and not give me an accurate rate, but as long as no input, or ouput is missed, I'll be happy. Right now seeedstudio is throwing a fit about my boards, so this whole thing (all of my spare time this past 14 months) may be for nothing...

PS. I asked in the comments in the code, I read that while() can freeze/slow the TLC5940 library somewhere, should I read Uart with If()?

Is this what I am looking to do, and have "chan' specify the row?::

// Defining Storage and Manipulation here (addresses)
//    Column   row
//           red      green           blue           mode           audc           audb           auds
// chan0   0,0      0,1      0,2      0,3      0,4      0,5      0,6
// chan1   1,0      1,1      1,2      1,3      1,4      1,5      1,6
// chan2   2,0      2,1      2,2      2,3      2,4      2,5      2,6
// chan3   3,0      3,1      3,2      3,3      3,4      3,5      3,6
// chan4   4,0      4,1      4,2      4,3      4,4      4,5      4,6

out to:
red value (0-4095)
green value (0-4095)
blue value (0-4095)
mode (0-?)
audio channel (0-1[L-R])
audio band (0-5)
audio sensitivity (0-31)
23  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 10, 2012, 03:25:08 pm
Sorry, my arrayDimensionCount was incremented too far smiley-grin. That would be a 2d array. Still perhaps some coding examples?
24  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 10, 2012, 03:12:22 pm
That would be a 3d array. I will be honest and say that this is not anything that I have any experience with.
25  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 10, 2012, 02:59:53 pm
I updated my first link with commented code. My packet structure and modes are at the bottom. Yes the only differences in the "Sorts" and "do's" are the arrays that they reference. How could I use a single two-dimensional array, when the data will differ between the channels? I also don't understand what you meant by tables. Examples would be simply amazing...
26  Using Arduino / Programming Questions / Re: Is there an easier way to do all of this? on: September 10, 2012, 02:38:29 pm
I assumed that in any way that I could reduce the repetitive sortChan() I could also apply to doChan(). If you would like me to apply comments to the rest of my code I shall. One thing I forgot to mention is that each "channel" is three TLC5940 outputs, grouped together to ouput Green, Red, and Blue. Each RGB Channel is (intended to be) independently controllable from each of the others. This is why they are separated the way that they are now.
27  Using Arduino / Programming Questions / Is there an easier way to do all of this? on: September 10, 2012, 02:21:09 pm
I am attaching a pastebin link to an ALMOST complete program for boards I am making. The question is, are the repetitive blocks the best way to do this, or is my brain broken since I programmed TI-83's in High School? The code interfaces a Teensyduino, MSGEQ7, TLC5940, and Mosfets to RGB LED Strips. I realize that I have not completed the save function and some of the modes are missing (incomplete, not hidden). The serial data to control the boards comes either from an android phone over bluetooth, or a physical controller that I will worry about later. If my code is childish and stupid, let me know, I can take it. Just no trolling please.
28  Using Arduino / Project Guidance / Re: Conflicting TLC5940 Information on: April 14, 2012, 05:29:49 pm
Thank you, so, If I use the software in the IDE, I use it's pin descriptions. Could you please look at my other forum post, perhaps you could help there too?
29  Using Arduino / Project Guidance / Re: Conflicting TLC5940 Information on: April 14, 2012, 04:24:43 pm

Unless I'm just stupid, which I may very well be, there appear to be different pins used for control between these pages. I am attempting to design a board in Eagle using the TLC5940 a Serial Bluetooth module and an MSGEQ7, this will be a shield...
30  Using Arduino / General Electronics / Re: Single PWM Trigger for Common Anode, and Common Cathode LED Strips on: April 14, 2012, 04:21:00 pm
Before I run a batch of bad boards, both the N and P channel mosfets from what I am reading are pin compatible with the IRF540 (as far as eagle is concerned). If not could someone help with eagle parts for the above schematic?
Pages: 1 [2] 3