Show Posts
Pages: [1] 2 3 ... 274
1  Using Arduino / Programming Questions / Re: declaring several arrays (LUTs) on: Today at 02:17:18 pm
Before you go any further could you please say which Arduino you have as your proposed arrays are chewing up an awful lot of memory.
2  Using Arduino / Programming Questions / Re: Conditional using a float that is "-0" and how that works on: Today at 05:23:32 am
Quote
This code produces this output:
Not for me though.

Here is the code I tested
Code:
void setup()
{
  Serial.begin(115200);
  float currentDbLevel;
  float max_dbLevel = -0.0001;
 
  Serial.print("currentDbLevel : ");
  Serial.println(currentDbLevel);
  Serial.print("max_dbLevel : ");
  Serial.println(max_dbLevel);

  if (currentDbLevel < max_dbLevel)
  {
    Serial.print (" YES ");
    Serial.print (currentDbLevel);
    Serial.print (" < ");
    Serial.print (max_dbLevel);
    Serial.print (" /// ");
  }
  else
  {
    Serial.println("tested false");
  }
}

void loop()
{
}
and the output
Quote
currentDbLevel : 0.00
max_dbLevel : -0.00
tested false

In your program are the variables global or in a function ?  It will make a difference as to the initial value of currentDbLevel
3  Using Arduino / Programming Questions / Re: Control MIDI note velocity via potentiometer on: Today at 04:33:22 am
I knowwww using global variables are frowned upon, but I'm a newbie so that's my excuse  smiley-lol
No need to apologise.  Global variables are very handy and as long as they are sensibly named and kept to a minimum they work well in the Arduino environment.

I will look at you program when I get a chance.

EDIT: or I would do but all I get from your link is an empty document.  Please attach your program to a post here using the Additional Options link at the bottom left of the message edit window.
4  Using Arduino / Programming Questions / Re: Control MIDI note velocity via potentiometer on: Today at 01:20:46 am
Sounds easy. 
Read a value from the pot using analog.Read() and map() the value returned to the range required.  For more detailed advice I suggest that you post your current code so that we can see how it is structured.
5  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 ?
6  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
7  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 ?
8  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 ?
9  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.
10  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); ?
11  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.
12  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.
13  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); ?
14  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 ?
15  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
Pages: [1] 2 3 ... 274