Show Posts
Pages: [1] 2 3 ... 936
1  Using Arduino / Project Guidance / Re: Feasability of two ways RS-232 repeater. on: September 01, 2014, 02:28:53 pm
doable, core could looks like this
Code: (snippet)
void loop()
{
  if (Serial1.avialable()) { Serial2.write(Serial1.read()); };
  if (Serial2.avialable()) { Serial1.write(Serial2.read()); };
}
2  Using Arduino / Project Guidance / Re: Feasability of two ways RS-232 repeater. on: September 01, 2014, 01:11:33 pm
yes

if you use a MEGA or a teensy 3.0 you can have hardware serials which are more reliable.
3  Using Arduino / Programming Questions / Re: Calculating Percentages yields 0% or 100%- never between on: September 01, 2014, 01:03:29 pm
some remarks:
you should declare the variables used in the ISR as volatile

The reason westfw's code didn't work was because there can be an overflow. int = 16 bit ==> -32768..+32767

if fanRPM is integer and at the max value 1380 the math 1380*100 = 138000 which does not fit into an int.

solution is to use an unsigned long. (32 bit) for exact math up to 4 billion something

Code:
unsigned long fanRPM;
then the formula

Code:
fanRPM_percentage= (fanRPM*100) / maxfanRPM;
will work as intended.


when converting the float variant to integer you better use round() which does proper rounding.
Code:
fanRPM_percentage=  round((fanRPM*100.0) / maxfanRPM);
4  Using Arduino / Programming Questions / Re: Day-of-Year conversion to Date, how??? on: September 01, 2014, 12:47:18 pm

  return Month, dayOfMonth;

this is valid C but does not do what you expect. IN C you can only return 1 value.

with respect to time:

ticks = 1387;                  // example
hr = ticks/60;              // 60 minutes in an hour 1387/60 = 23  (truncated integer math )
mi = ticks - hr*60;     // 1387 - 1380 = 7


5  Using Arduino / Programming Questions / Re: Calculating an object's angle using 3 HC-SR04 sonar ranging modules on: September 01, 2014, 12:32:21 pm
Thanks for the attempt but Pythagoras' will not work since the person may not be stood perpendicular to the sensor ..

I never said that was needed. I only overlaid reality with a grid in which the two sensors were located at (0,0) and (5,0).
The person could be at any point(x,y).

Quote
and I have to keep it as accurate as possible. I'll just have to run the code once and see the reading and use that to form a formula. Again thank you for your time and effort smiley. I'll post the answer if and when I get it.
welcome,
I am interested in how it will be solved ...
6  Using Arduino / Programming Questions / Re: Multiple LED's blink without delay on: August 31, 2014, 11:47:42 am

simplified the code a bit, find the 7 differences smiley-wink

Code: (not tested)
int ledPins[] = {
  9,8,7,6,5,4,3,2,14,15,16};

unsigned long previousMillis = 0;
unsigned long interval = 1000;

int x = 0;

void setup()
{
  Serial.begin(19200);

  for(int i= 0; i < 11; i++)
  {
    pinMode(ledPins[i], OUTPUT);
    digitalWrite(ledPins[i], HIGH);
  }
}

void loop()

  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval)
  {
    previousMillis = currentMillis;
   
    // switch OFF
    digitalWrite(ledPins[x], HIGH);       // left
    digitalWrite(ledPins[9-x], HIGH);  // right

     x++;
     if (x == 4) x = 0;

    // switch ON
    digitalWrite(ledPins[x], LOW);       // left
    digitalWrite(ledPins[9-x], LOW);  // right

    digitalWrite(4, !digitalRead(4));  //invert middle LED every step

  }
}
7  Using Arduino / Installation & Troubleshooting / MOVED: c++ visual studio form application serially reading data from arduino on: August 31, 2014, 11:30:26 am
This topic has been moved to Interfacing w/ Software on the Computer .

http://forum.arduino.cc/index.php?topic=264141.0
8  Using Arduino / Sensors / Re: Heat Sensor, please help me on: August 31, 2014, 09:02:25 am
- http://www.ti.com/lit/ds/symlink/lm35.pdf -

==> Celsius
9  Using Arduino / Sensors / Re: graph of the muscle contraction on: August 31, 2014, 09:00:52 am
Which version of processing do you use?
10  Using Arduino / Sensors / Re: graph of the muscle contraction on: August 31, 2014, 08:52:09 am

The error message in the processing code means that you read more data from the Arduino than fits in the memory you reserved for it. Need to dive in the processing code to see what happened.

tbc
11  Using Arduino / Sensors / Re: graph of the muscle contraction on: August 31, 2014, 08:50:31 am
Quote
the arduino example was correct
did you see the values of the Arduino program change when the muscles contracted

I did have a look at the Arduino code and although it is straightforward I think there is room for improvement.
The Arduino has only one ADC and multiplexes to read the 6 inputs.
This means the ADC sees a different signal every time and has no chance to stabilize.
By reading every port twice and use the second reading the quality of the signal will be more stable.

12  Using Arduino / Sensors / Re: graph of the muscle contraction on: August 31, 2014, 07:38:51 am
tell more about the error?
as there are zillion possible errors ....

what is the output in the Serial monitor?
(do not start the Processing SKetch, only the Arduino from the IDE and start the Serial monitor)
13  Using Arduino / Installation & Troubleshooting / Re: Arduino software display garbled on: August 31, 2014, 06:20:07 am

screenshot?
14  Community / Website and Forum / Re: Issue accessing the forum using IE on: August 31, 2014, 06:14:24 am
have same problems with Chrome lately.

Not investigated, but I assume it is related to the load of the forum that some steps are not handled in time as I see it happen in burst modes when I open multiple tabs simultaneously.

annoying smiley-sad
15  Community / Exhibition / Gallery / Re: Don't Cross The Streams (FP scientific calculator serial co-processor) on: August 31, 2014, 06:12:00 am
you probably need to install the Stream library

which version of the IDE are you using ?

(Brabant, ook NL)
Pages: [1] 2 3 ... 936