Show Posts
Pages: [1] 2 3 ... 60
1  Using Arduino / Project Guidance / Re: Problem with FFT on: September 17, 2014, 01:45:08 pm
Where can i get the value for these constants and What are they for?

This is a lookup table for the value of sin(x*K)*127.
The values are as you see them here.
2  Using Arduino / Programming Questions / Re: Calibrating an Accelerometer on: September 14, 2014, 07:00:09 pm
Code:
  Serial.print(" Scales:");
  for(byte i; i < 3; i++) {
    Serial.print(scale[i]);
    Serial.print(" ");
  }

i is not being initialized.  You want
Code:
for(byte i = 0; i < 3; i++) {

You've done this in several places.
3  Using Arduino / Project Guidance / Re: Tig Welder PWM Controller Arduino on: September 07, 2014, 01:59:14 pm
This is pretty old but has a bunch of interesting ideas.
http://www3.telus.net/public/a5a26316/TIG_Welder.html

My understanding is that you'd want to go with IGBTs vs MOSFETs for most welding applications.  Welding voltages could be on the high end for a lot of MOSFETs and a superimposed HF arc starter voltage would be way higher voltage than a MOSFET can handle.
4  Using Arduino / Project Guidance / Re: Tig Welder PWM Controller Arduino on: September 07, 2014, 12:07:47 pm
Hello people, i have a stick welder inverter type wich ive converter for tig welding, but i need to make a pwm controller for it, here its the graph.I need to control peak amperage and background current, pulse width and frequency. can be done with a arduino?

I believe the required high frequency pulse signal can be generated by the hardware PWM output (analogWrite()).
The low frequency signal would be readily handled in software.

There's usually more to a good TIG current profile than simple on/off duty cycle though.  You should be able to control positive electrode/negative electrode/off duty cycle, as well as having ramp up/down current profiles at the start/end of a weld and all that stuff.
5  Using Arduino / Project Guidance / Re: Pulsein voltage limits whats my upper limit? on: September 03, 2014, 12:45:55 pm
To connect the high voltage you have a couple of options.  A resistor voltage divider is simple and will work fine.  A 10K/33K network will give you 3.5V from 15V and that will feed into an arduino input with no particular fuss.   Depending on what the 15V signal coming from a "ramps board" is like -- and if it could have spikes or negative voltages -- you might want an additional zener diode for clamping and reverse blocking diode.
6  Using Arduino / Project Guidance / Re: Find nearest multiple of 8 from a variable? on: September 02, 2014, 08:28:06 am
  • divide by 8
  • add one to the result
  • multiply that by 8 again
7  Using Arduino / Project Guidance / Re: RSSI-urgent help on: August 28, 2014, 03:02:23 pm
Did you look at the other thread I mentioned and get the code for obtaining the RSSI figure from your XBee?
Is it working and giving you a value?

Assuming so, take your XBees outside and go for a walk.  Measure -- maybe in paces -- the distance and record the RSSI figures.  Record a lot of data -- like 100 observations at different distances.  Stick the data into excel or something and create a scatter plot.

Is there a useful correlation?  If so, you can fit a curve to the data and use that as a distance measurement.

Do the same thing indoors -- maybe in a long school hallway.
Then again, in a row of offices, moving one office farther each time.

It will make an interesting experiment, but you will discover that RSSI figures are only partly correlated to distance.  They will vary by the relative orientation of the two antennas and by the surrounding materials just as much as by distance.
8  Using Arduino / Project Guidance / Re: Reading the status of a digital pin on: August 27, 2014, 02:36:07 pm
http://arduino.cc/en/Reference/DigitalRead

I've been looking around in many tutorials

Your research skills want some improvement.
9  Using Arduino / Programming Questions / Re: Could I save more SRAM ? on: August 27, 2014, 02:21:34 pm
It's a different way to skin the same cat.

In addition to moving your strings into PROGMEM, where feasible, you might look at using smaller types.  There are a few places you are using int (2 bytes) where a uint8_t or int8_t (byte) type would do.
10  Using Arduino / Programming Questions / Re: Efficient Way of Sending Data via Serial on: August 27, 2014, 02:02:43 pm
HardwareSerial.cpp has a small buffer that it uses for outgoing data.  When you use print() and friends, and the data you are printing does not fit, then the print() blocks until space is available and the data can be sent.

Because your sketch spends some of its time blocked on print(), it misses some of the moments when millis() % 100  == 0.  This coupled with the very real likelihood that millis() % 100 of often not zero, even 100ms after a point that it WAS zero, as PaulS points out, is likely what you're seeing.

There is, unfortunately, no way to sense if there is space in the transmit buffer.  You can use flush() to wait for everything to be sent, but there is no async way to test if flush() or print() would block.  You would have to hack HardwareSerial.cpp to add this feature.
11  Using Arduino / Project Guidance / Re: RSSI-urgent help on: August 27, 2014, 11:01:37 am
Google found me all kinds of interesting stuff, including this: http://forum.arduino.cc/index.php/topic,59992.0.html
12  Using Arduino / Project Guidance / Re: Etch-resistant thermometer. on: August 27, 2014, 10:35:24 am
I am not sure how accurate a contactless infrared thermometer would be in this application, but it might be worth a go.

http://hackaday.com/2014/03/20/modular-arduino-based-infrared-thermometer/
13  Using Arduino / Programming Questions / Re: Using pointers within a library on: August 27, 2014, 10:22:50 am
Code:
void IMUlib::readIMU(int16_t *aX, int16_t *aY, int16_t *aZ, int16_t *gX, int16_t *gY, int16_t *gZ){

void IMUlib::readIMUForm(int16_t *aX, int16_t *aY, int16_t *aZ, int16_t *gX, int16_t *gY, int16_t *gZ){
  readIMU(&aX, &aY, &aZ, &gX, &gY, &gZ);

In readIMUForm() aX, xY etc are pointers to int already.  There is no need to take THEIR addresses when passing to readIMU().

You probably want:

Code:
void IMUlib::readIMUForm(int16_t *aX, int16_t *aY, int16_t *aZ, int16_t *gX, int16_t *gY, int16_t *gZ){
  readIMU(aX, aY, aZ, gX, gY, gZ);
  *aX = *aX/16384;
}
14  Using Arduino / Project Guidance / Re: Need help to splitt a string that comes from serieport on: August 20, 2014, 11:53:53 am
Where does the string come from?  If your reading it character-by-character from a stream, I would say your best bet s to parse it on the fly.  If you have to parse the string in memory, have a look at strtok()

http://www.nongnu.org/avr-libc/user-manual/group__avr__string.html#gac0dbc25e8b202114031a4aa2a7c5177b

You can google for zillions of examples.  Your code would give <BS><CR><LF> ("\b\r\n") as delimiters, then look at the strings found.  The ones that aren't "" are what you are looking for.
15  Using Arduino / Programming Questions / Re: I cant insert code, please help..... on: August 18, 2014, 10:35:22 am
this is going to be very vague

Agreed: vague in the extreme.

It is not possible for anyone to help you without at least one of, and ideally both of:

(1) the whole actual sketch you are struggling with, and
(2) the whole actual error messages given by the IDE when you build it.

Quote
is there a tutorial about when, where, why and how to use the "{ }" syntax

http://arduino.cc/en/Reference/HomePage
Pages: [1] 2 3 ... 60