Show Posts
Pages: 1 2 [3] 4 5 ... 111
31  Using Arduino / Programming Questions / Re: multiplication problems on: August 18, 2014, 12:35:03 pm
And also be aware that using "unsigned long" may only introduce another problem. It will work if the two multiplicands are always positive. But if you have -1000*1000, this will, of course, overflow a 16-bit integer but it can't be represented in an "unsigned long" either. If you can have negative numbers, you must use "long", not "unsigned long".

Pete
32  Using Arduino / General Electronics / Re: Where should I connect fuse? on: August 18, 2014, 10:45:11 am
A fuse should always be placed between the voltage source and the circuit (load).
12V -> fuse -> circuit -> Gnd

Pete
33  Using Arduino / General Electronics / Re: Safety match activation energy on: August 17, 2014, 04:46:56 pm
You don't need any of the angular frequency stuff.
The specified voltage of an AC supply is its RMS voltage which will dissipate the same heat in a resistor as a DC supply of the same voltage. If the values are now 220VAC and 276 ohms, the power dissipated in the wire is 220*220/276 = 175 watts.

Pete
34  Using Arduino / General Electronics / Re: Safety match activation energy on: August 17, 2014, 03:19:26 pm
Quote
would leave about 6.45watts
I don't think so. 240VAC is the RMS voltage which means it is the voltage equivalent of a DC supply. So, the power dissipated by the wire will be V*V/R = 240*240/300 = 192W.

Pete
35  Using Arduino / Sensors / Re: Understanding and Converting 2's Complement into Decimal for ITG3205 Gyroscope on: August 17, 2014, 02:57:17 pm
Quote
Is this because the second byte is changed out of 2's complement?

No. I presume it is because adding the value of g_offx is enough to change the result significantly.

Quote
two X bytes were 9 and 255, correspondingly

Which way round are they received? If the 9 is the LOW order byte, then the result is 0xFF09 which is -247.

You need to know the value of g_offx before you can correctly interpret the result of
Code:
result[0] = ((buff[2] << 8) | buff[3]) + g_offx;

Pete
36  Using Arduino / Project Guidance / Re: needhelp about Arduino with camera embedded on: August 17, 2014, 01:46:25 pm
I think the Raspberry Pi can do that but I've never used one. Someone else will have to help with that.

Pete
37  Using Arduino / Project Guidance / Re: needhelp about Arduino with camera embedded on: August 17, 2014, 01:05:43 pm
What are you expecting to do with the video camera? If you think you are going to stream video through the Arduino to wifi you can stop right now. There's no way the Arduino can keep up with a video stream.
The Arduino can be used to control a video camera- e.g. turn it on and off etc. - but that's it.

Pete
38  Using Arduino / Networking, Protocols, and Devices / Re: RTC3231 with I2C error when connect with Ethernet shield on: August 17, 2014, 12:57:04 pm
I2C requires pullups on SDA and SCL. If they aren't already there you have to add them.

Pete
39  Using Arduino / Sensors / Re: Understanding and Converting 2's Complement into Decimal for ITG3205 Gyroscope on: August 17, 2014, 12:55:06 pm
Your description completely contradicts what the code (what there is of it) is actually doing.
Quote
TEMP_OUT_H/L 16-bit temperature data (2’s complement format)                                   (result[0] and result[1])

Ahhh. your comment is wrong, it should say:
Quote
TEMP_OUT_H/L 16-bit temperature data (2’s complement format)                                   (buff[0] and buff[1])

Code:
result[0] = ((buff[2] << 8) | buff[3]) + g_offx;

The sensor values are read one byte at a time and have to be reconstructed into a 16-bit integer. result[0] is a 16-bit number which is constructed of buff[2] as its high-order byte and buff[3] as the low order byte. The result is a signed twos-complement 16-bit integer which you can print as Serial.println(result[0]).

You don't need to convert to decimal, Serial.println does that for you. Internally, Arduino's integers are 16-bit twos-complement anyway.

Pete

40  Using Arduino / Networking, Protocols, and Devices / Re: RTC3231 with I2C error when connect with Ethernet shield on: August 17, 2014, 10:45:51 am
If that doesn't fix things, you should add the pullups.

Pete
41  Using Arduino / Networking, Protocols, and Devices / Re: RTC3231 with I2C error when connect with Ethernet shield on: August 16, 2014, 10:18:37 pm
Do you have a 4.7k pullup resistor on both SDA and SCL?

Pete
42  Using Arduino / Programming Questions / Re: Problem getting the MySQL Connector to take a variable on: August 16, 2014, 04:50:47 pm
This part of the error message
Quote
Connector::cmd_query(const char*)
is telling you that the function is expecting a null-terminated C string, not a String. You should avoid the use of String anyway. It doesn't work well on Arduino.

Pete
43  Using Arduino / Programming Questions / Re: Hello computer, how loud are you? on: August 14, 2014, 03:20:07 pm
Seeing as it appears that it can be done, I went googling for some C code.
There's C++ code here which prints the current master volume setting. I compiled and tested it. It works on Win 7 Pro X64.

Pete
44  Using Arduino / Programming Questions / Re: Hello computer, how loud are you? on: August 14, 2014, 01:49:30 pm
Microsoft has a webpage which describes the systray program which allows the user to alter the volume levels. The program is SndVol32.exe.
But the webpage says "Note that there is no way to programmatically access the functionality of this program".
It would appear that the answer to your question is no.

Pete
45  Using Arduino / Project Guidance / Re: Alternatives to the float library on: August 12, 2014, 12:40:06 pm
If the division is A/B where A and B are integers, the integer part of the result is just A/B. If you want to display two decimal places, multiply the remainder of the division by 100 and divide by B again. ((A%B)*100)/B. The only thing you need to be careful of is that there might be a leading zero in the fraction, e.g. the full answer might be 23.05.
For a different number of decimal places just adjust the multiplication by 100 to, for example, 10 for one decimal place.

Pete
Pages: 1 2 [3] 4 5 ... 111