Loading...
  Show Posts
Pages: 1 ... 5 6 [7] 8 9 ... 16
91  Using Arduino / General Electronics / Re: How to test power supply under a load? on: March 07, 2013, 03:49:25 pm
Quote
Yes one measures voltage in parallel with the power supply output terminals and one measures current in series with the load.

I'm bored so I drew a pic of that  smiley-cool
Thank you, that's actually what I was looking for! smiley
If it's regulated supply (aka. switching) then it shouldn't make any difference.

PS: You could always try one and see ... that's how we learn! smiley

Yes it's switching DC to DC based on LM2596. I'm getting different output voltage depending on the input voltage (i.e. at 5 V in I'm getting 4.8V, and at 12 V I could be getting 5.5V). I read it it could be because I'm measuring without a load, thus my original question smiley
Not sure what you mean by "try one and see".
92  Topics / Product Design / Re: Eagle v6.x CAM File for OSH Park's Fab Service on: March 07, 2013, 03:41:46 pm
CAM file makes the gerber files needed for different PCB fab companies.  Uploading just a .brd file to OSH Park is not on his instructions for uploading.
True for other fab companies, but OSH Park do accept regular Eagle board files smiley They already processed 3 of my orders.  I agree it's a little cryptic in their instructions:
Quote
We are currently processing uploaded files with Eagle CAD version 6.2.1 and has been tested with Eagle CAD files through 6.3. If you are using a newer version than 6.3 then please contact us, or generate your own gerber files.
93  Topics / Product Design / Re: Eagle v6.x CAM File for OSH Park's Fab Service on: March 07, 2013, 02:27:32 pm
Out of curiosity why is CAM file needed?  I just submit native Eagle's BRD file and it works great... Am I missing something?
94  Topics / Product Design / Re: sourcing parts help on: March 07, 2013, 01:54:57 pm
+1 for TaydaElectronics!  I now buy majority of my stuff there, nothing can beat those prices.
But watch out for some electromechanical parts quality like John_S mentioned.  For example their panel mounted DC jacks, are pretty bad. I had to throw out batch that I purchased...
Shipping (to US) is also very cheap, but delivery times vary. Looks like they have warehouse in US so if stock parts you'll get it fast, but sometimes they ship from China and it can take 2 weeks...
95  Topics / Product Design / Re: Itead, Members with Experience... on: March 07, 2013, 01:35:58 pm
Came upon this thread while searching on more info about iTead.
I just placed order with them last week, but never got confirmation e-mail so I emailed them right away with gerber files.  Sunny replied that he got them, so I thought everything is ok, until I just got Invoice e-mail from iTead.  Their online system doesn't show that I placed any order, I hope it's just a glitch...
BTW, my experience with OSH Park was great, from submitting design to getting notifications when it was sent to the fab. Turnaround time varies, but quality of PCB was amazing.  If they only can be as competitive with prices as iTead I would stick with them smiley
96  Using Arduino / General Electronics / How to test power supply under a load? on: March 07, 2013, 10:05:44 am
I have a bunch of adjustable DC power supplies which I need to adjust to 5 VDC output, but I suspect that when I just test it with multimeter it won't show correct voltage. Would would be a simple way to test it under load? Put some kind of resistor between power supply output and multimeter?
97  Using Arduino / Programming Questions / Re: Constructing array of chars on: March 06, 2013, 09:22:47 am
Use strcat. eg.

Code:
strcpy (myString, "");

if (condition1) strcat (myString, "Mon ");
if (condition2) strcat (myString, "Tue ");
if (condition3) strcat (myString, "Wed ");
Works like a charm! Thank you very much!!!
98  Using Arduino / Programming Questions / Constructing array of chars on: March 05, 2013, 10:05:51 pm
I'm trying to construct a dynamic array of chars (basically a string) from predefined text pieces, but don't know how. I can't use String function since it's very buggy in Arduino IDE...
something like this:
Code:
char myString[20];
char myString2[40];
....
if (condition1) myString = "Mon "
if (condition2) myString = myString+"Tue "
if (condition3) myString = myString+"Wed "
...
snprintf(myString2,sizeof(myString2), "Alarm %d is set %s at %d:%02d AM",alarmNumber, myString, myhours,alrmMM[alrmNum]);

Just not sure how to combine strings (myString = myString+"text")...
99  Using Arduino / Programming Questions / Re: Question about sprintf and memory allocation on: March 05, 2013, 01:48:04 pm
If you use snprintf() instead, it will avoid trampling off the end of the array.
Wow I didn't know about this function! Thanks a lot!
100  Using Arduino / Programming Questions / Re: Question about sprintf and memory allocation on: March 05, 2013, 11:52:15 am
Thanks everyone! smiley
Yeah I didn't know about end of string character that's added, this would help!
101  Using Arduino / Programming Questions / Re: Question about sprintf and memory allocation on: March 05, 2013, 11:30:26 am
You don't need to initialise the array, apart from declaring it, because sprintf is going to write over what is there anyway.
Just to clarify.
If for example array is 100 characters long.
First time I call sprintf to fill it with 100 characters.
Then I call it but only fill with 50 characters.
Will it still hold remaining 50 characters from first call at the end?
102  Using Arduino / Programming Questions / Re: Question about sprintf and memory allocation on: March 05, 2013, 11:22:03 am
Yes in the first case sprint will hapilly write over the end of your array and stomp all over whatever was in those next memory locations.  Hope it wasn't anything important cause it is corrupted now.  It is your responsibility to make sure you declare the array big enough if you don't want to corrupt memory.  The compiler won't do that for you.

In the second case it has nothing to do with sprintf.  In the second case you've declared a local variable.  As soon as that function returns that variable goes out of scope.  So you can't use it anywhere else.  The same would happen if it was an intended variable and you had just done a simple assignment.
Uh oh, that might explain some unexplained things that's been happening to my program smiley
Thanks for the info!
What about initializing char array contents?  Does sprintf do it every time itself I need to take care of it manually?
103  Using Arduino / Programming Questions / Question about sprintf and memory allocation on: March 05, 2013, 11:06:29 am
I've been using sprintf function in my sketches successfully to format and output text to LED display.  One thing that puzzles me is that I'm not exactly sure how it allocates memory (and I suspect it causes some weird issues). Specifically if I declared a char array of certain size, but sprintf filled it with a lot more characters it still somehow works.
For example
Code:
char myText[4];
sprintf(myText, "Hello. Today is %02d, %d ",day(),year());
It will work despite having only 4 elements in the array. Why?  
If I call sprintf again it seems like it erases previous values in myText array. Is it really so, or I'm imagining things? smiley

Also for some reason it seems I have to declare char array globally. If I create a local version inside function, and then pass it to another function, Arduino usually crashes or reboots.
i.e. something like this:
Code:
void makeText () {
char myText[4];
sprintf(myText, "%02d, %02d ",day(),year());
showDate(myText);
}
104  Using Arduino / Sensors / Re: Photoresistor not working with ATMega644p on: February 27, 2013, 03:51:23 pm
Thanks CrossRoads! I thought I was going crazy there for a minute smiley
So what would be "True C" command to address Analog port "PA0" directly and read value from it?
As far as making it input I think I can do something like this:
Code:
DDRA=B11111110;
But totally not sure how to AnalogRead from it then?
105  Using Arduino / Sensors / Re: Photoresistor not working with ATMega644p on: February 27, 2013, 03:26:09 pm
I got it working, kind of. But would like to understand. I tried reading various Analog ports and eventually got response from A2. Even tho it supposed to be A0.
But I have no thing connected to other analog ports (i.e. A0, A1,A3) and I'm reading some values from them. Completely confused. How are analog ports supposed to be referenced in IDE for ATMega644p chip?
Pages: 1 ... 5 6 [7] 8 9 ... 16