Show Posts
Pages: 1 ... 44 45 [46] 47 48 ... 203
676  Using Arduino / Motors, Mechanics, and Power / Re: Solenoid type on: June 13, 2014, 11:58:28 pm
The important bit you left out of that drawing,  is the spring.   The magnet will only pull the armature one way.
677  Using Arduino / Motors, Mechanics, and Power / Re: Sensing high voltage of a triangle wave on: June 13, 2014, 11:52:19 pm
Well, yes,  and no.  If you connected that "DC" waveform to any sort of load,   and wanted to calculate the power being used or dissipated by the load,  it is an "rms" calculation that you would actually be doing.
678  Using Arduino / Programming Questions / Re: Is a serial monitor attached? on: June 13, 2014, 11:37:58 pm
I had this problem with an application,   and I didn't try to solve it by messing with the serial connection.   I added a switch to my little device,   connected to a digital input pin,  if the switch is on,  send ( or try to send )  the serial data to the computer,  if the switch is off,   then don't.
679  Using Arduino / Programming Questions / Re: Breaking sweep program trouble on: June 13, 2014, 11:32:30 pm
Your first code makes no sense.

In each cycle through loop() ,  you are reading the photocell once,   and then moving the servo through 180 degrees and back again.

If you are scanning the surroundings,   surely you need to take a reading of the photocell at each step through the scan ?
680  Using Arduino / Sensors / Re: Colour Sensor Output on: June 13, 2014, 11:29:13 pm
I don't know about the lego sensor,  but there are several descriptions on the internet of how other colour sensors work.   The basic idea they use,  is to measure the amount of red, blue, and green light being reflected from the object placed in front of them.
681  Using Arduino / Programming Questions / Re: a problem using Matrices on: June 13, 2014, 11:27:08 pm
Apart from the low amount of memory,  very slow floating point calculations and lack of double precision,     a properly written C/C++ implementation of matrices should work on the Arduino.
682  Using Arduino / Interfacing w/ Software on the Computer / Re: Convert to char array in int array on: June 12, 2014, 09:08:23 pm
The reason for your first error,  is that the atoi( )  function is not expecting a single char value,  as an input.   People are not generally interested in single digit numbers,   and if they are,  they use this
Code:
char c = '7' ;
int val = c - '0'  ;     // here val will contain the integer value 7

the function atoi( ) expects its argument value to be an array or char or a pointer to char ( which are really the same thing ),   and it will look at char values starting from that address until it finds a null ( zero ) byte.
683  Using Arduino / Interfacing w/ Software on the Computer / Re: Convert to char array in int array on: June 12, 2014, 09:03:55 pm
So,  you want to convert and array of char,  to an array of integers ?

If your array of chars is  '3'  '2'  '1'

then what "array of integers" do you expect to see at the end ?    3   and  2  and  1  in an array  ?   Or  321 (three hundred [and] twenty one),   which is one integer number,  not an array.
684  Using Arduino / Interfacing w/ Software on the Computer / Re: Send string from c# to Arduino and split it. on: June 12, 2014, 09:00:30 pm
You should solve one problem at a time.
Make sure you can do the serial transmission from your other computer to the arduino.   Just print the message as you receive it.
After you have got that to work properly,   then worry about parsing it.
685  Using Arduino / Motors, Mechanics, and Power / Re: Selecting the right relay on: June 12, 2014, 08:46:22 pm
You need to think about how you are going to power the coil.   You will need to use a transistor on the arduino output pin,   the energise the coil of the relay,  to close the contact on your actual load circuit.

There are several alternatives.   You can provide power for the relay coil from your arduino power supply ( but not actually through the arduino ),   or you can provide power for the coil from the same 24V source you are switching,  or from some other source ( perhaps not a relevant scenario in your low-voltage case ).

Your decision on this alternative will be a factor in which relay will work for you,    more so than the voltage or current capability of the relay output.
686  Using Arduino / Sensors / Re: Photosynthetic Light Sensor 0-5v Input on: June 12, 2014, 06:58:25 pm
Fluorescent light is going to be LESS constant than the sun,  because it is flickering on and off 100 or 120 times per second.
687  Using Arduino / Sensors / Re: BMP085 fluctuating readings on: June 12, 2014, 06:53:57 pm
The noise on that sensor corresponds to about 1 metre of altitude.    If you take many samples and average them,   you can discriminate difference in altitude of about 30 cm.
688  Using Arduino / Programming Questions / Re: Convert float to byte and back again? on: June 12, 2014, 06:42:33 pm
Code:

union cvt {
float val;
unsigned char b[4];
} x;

float yourValue =  4338.123 ;
x.val = yourValue ;


data.data[0] = hour;
data.data[1] = minute;
data.data[2] = seconds;
data.data[3] = milliseconds;
*put float here*
data.data[4]=x.b[0] ;
data.data[5]=x.b[1] ;
data.data[6]=x.b[2] ;
data.data[7]=x.b[3] ;

data.data[8] = day;
data.data[9] = month;
data.data[10] = year;
689  Using Arduino / Motors, Mechanics, and Power / Re: Suitable transistor for controlling 180w 12v motor on: June 11, 2014, 11:29:53 pm
It's not clear to me why you have both 5v and 12v  connected to the arduino ?

If the 12 V is to monitor the battery voltage using the analog input,  you will need to reduce that to an acceptable range for the analog input ( < 5 V )
690  Using Arduino / Programming Questions / Re: Double arithmetic on: June 11, 2014, 11:20:08 pm
You can use integer or float types in your loop,   but the comparison really should match whatever the hsv[3] is that you are comparing it to.
Pages: 1 ... 44 45 [46] 47 48 ... 203