Show Posts
Pages: [1] 2 3 ... 273
1  Using Arduino / Programming Questions / Re: Unlogical but simple errors coming from P5 to arduino on: July 31, 2014, 04:11:13 pm
Code:
const int constSpielfeldLeer = 2;            // Feld leer
Yes, that is valid code

Code:
int[][] arrayCopy2D ( int src [7][7])
That isn't.  Why not make the array global ?
2  Using Arduino / Programming Questions / Re: Unlogical but simple errors coming from P5 to arduino on: July 31, 2014, 03:06:27 pm
It's allowed if you really needed it, but you don't.

Next observation
Code:
  currentConfiguration = configurationEnglishBoard
Perhaps you could use the spare semi-colon from the #define
3  Using Arduino / Programming Questions / Re: Need advice / suggestion about PIR sensor detector on: July 31, 2014, 01:02:37 pm
Quote
I bought one
Just one ?  What will it be communicating with ?
4  Using Arduino / Programming Questions / Re: Unlogical but simple errors coming from P5 to arduino on: July 31, 2014, 12:58:31 pm
Let's start with a simple one.
Code:
#define intConstEnde 7 ; // 0..10, also 11 Felder breit und hoch: hier 10 eintragen
What will intConstEnde  be replaced with in the code when this #define is executed ?
5  Using Arduino / Programming Questions / Re: How to read values over serial on: July 31, 2014, 12:48:57 pm
Queries about reading input from Serial, splitting it into parts and acting on the value of the parts must be one of the most common questions raised here.

As a start, on the Arduino wait until there is serial data available (Serial.available() then read a byte (Serial.read()) and print it so that you can see what you are getting.  The clever stuff about splitting up the input, determining which servo is specified and moving that servo can come later. 

Meanwhile, if you browse back a few pages in this section you will find similar questions to yours being asked and answered.
6  Using Arduino / Programming Questions / Re: Help using ServoTimer2 (deegres to microseconds) on: July 31, 2014, 10:09:22 am
Can we go back to basics and establish the angle that your servo moves through between writeMicroseconds(1000); and writeMicroseconds(2000); ?
7  Using Arduino / Programming Questions / Re: Printing variable on arduino LCD screen? on: July 31, 2014, 04:42:59 am
Take note of the comments from others but I think that you misunderstand how Serial.read() works. 

Serial.read() reads one character from the serial interface into the specified variable.  So your program waits until at least one character is available, reads it, clears the LCD and initialises the LCD, both of which position the LCD cursor to 0,0, then you position the cursor to 0,0 again and display the first character read from serial.  Then you wait 1 second before executing the same set of instructions over again including clearing the LCD and setting the cursor to 0,0 three times before displaying the next character available from serial.
8  Using Arduino / Programming Questions / Re: aquarium auto fertilizer code check on: July 31, 2014, 01:20:35 am
Quote
can you explain why byte is different than int?
A byte uses half the memory space of an an int.  It may not seem like much of a saving but could be important in a larger program, so it is good practice to get used to using the smallest variable type applicable to the data being held.
9  Using Arduino / Programming Questions / Re: Help using ServoTimer2 (deegres to microseconds) on: July 31, 2014, 01:14:50 am
Quote
Is there any documentation somewhere about microsecond as a variable of rotation (such as radiants or deegres),
There is no documentation as to the relationship between the number of microseconds and degrees of rotation because each type of servo will vary as to how far it can rotate, hence the suggestions to try the extremes of servo.write() and writeMicroseconds().  Specialist servos, such as sail winches, may turn through 360 degrees or more from one end of their travel to another whilst when using continuous rotation servos the parameters used in the functions control the speed and direction of rotation rather than the angle.

From what you say your servo rotates 180 degrees end to end between servo.write0); and servo.write(180);   What does it do with writeMicroseconds(1000); and writeMicroseconds(2000); ?
10  Using Arduino / Programming Questions / Re: Help using ServoTimer2 (deegres to microseconds) on: July 30, 2014, 02:56:57 pm
Quote
Is there any way to know if my servo rotates from 0-180
Put the output arm on, servo.write0); then servo.write(180); 
How many degrees does the output arm rotate between the two ?
11  Using Arduino / Programming Questions / Re: Rotary Switch to change Arduino Scripts on: July 30, 2014, 05:06:23 am
Good for you in getting it working but you should be able to simplify the tests for switch position.
Code:
// IF/Else statements regarding Values through switch
if (analogValue < 200)  //switch at zero volt end
{
  Serial.println("Rotary Position 3");
}

else if (analogValue > 1000) //switch at 5V end
{
  Serial.println ("Rotary Position 1");
}

else
{
  Serial.println ("Rotary Position 2");   // not at either end so it must be in the middle
}

Your next task is to make it print a message only when the switch position is changed using the principle shown in the state change detection example in the IDE
12  Using Arduino / Programming Questions / Re: Split AND convert char array to two separate integers. on: July 29, 2014, 04:26:35 pm
atoi() expects the chars to be converted to an integer to be in a null terminated C style string.  Yours aren't.
13  Using Arduino / Programming Questions / Re: Read only the first row of data from a loop on: July 29, 2014, 03:31:45 pm
I can't help thinking that you are overengineering this.
Read the 4 initial values into an array in setup() as you have.  Then, each time through loop() read each sensor and do the subtraction as part of the Serial.print().

Something like this
Code:
#define numberOfSensors 4 //define the number of sensors I am using
int firstReading[4];

void setup()
{
  Serial.begin(115200);
  for (int thisSensor=0; thisSensor < numberOfSensors; thisSensor++)
  {
    firstReading[thisSensor]=analogRead(thisSensor);
  }
  for (int i=0;i<4;i++)
  {
    Serial.print(firstReading[i]);
    Serial.print(",");
  }
  Serial.println();
}

void loop()
{
  for (int thisSensor = 0; thisSensor < numberOfSensors; thisSensor++)
  {
    Serial.print(firstReading[thisSensor] - analogRead(thisSensor));
    if (thisSensor != 3)
    {
      Serial.print(",");
    }
  }

  delay(1); 
  Serial.println();   //print a blank line - this line is important because Processing will start a serial event only after reading this blank line.
}
14  Using Arduino / Programming Questions / Re: Read only the first row of data from a loop on: July 29, 2014, 01:01:29 pm
Quote
All I want to do is take the first row (44,23,0,321)-store it in a separate array and then take the next rows and subtract from this first row.
Why the need for 2 arrays ?
Put the first set of readings in row 0 of a 2 dimension array then put each subsequent set of readings in row 1 of the same array before doing the subtraction.
15  Using Arduino / Programming Questions / Re: PYTHON IDE FOR ARDUINO on: July 29, 2014, 11:05:56 am
Do you want an IDE/Compiler written in Python or one that allows you to develop Python code ?

Either way you are out of luck I would think.
Pages: [1] 2 3 ... 273