Go Down

Topic: array (Read 477 times) previous topic - next topic

Johny_honda

Nov 21, 2012, 10:12 pm Last Edit: Nov 21, 2012, 10:34 pm by uwefed Reason: 1
 Hallo habe noch ein kleines Problem.
 habe  2 array deklariert
 
Code: [Select]
int akkuwert[32];  
 float akku [32];  

 for (int x=1; x <= 17; x++){
 Wire.beginTransmission(30); // transmit to device
 Wire.write(0);            // akku all off
 Wire.endTransmission();    // stop transmitting  
 delay(10);  
 Wire.beginTransmission(30); // transmit to device
 Wire.write(x);            // sends one byte
 Wire.endTransmission();    // stop transmitting
 delay(10);  

   akkuwert(x) = analogRead(0);
   akku(x) = akkuwert(x) / 305.913;
}

bekomme die Fehlermeldung :

error: 'akkuwert' cannot be used as a function
error: 'akku' cannot be used as a function

müsste doch eigentlich funktionnieren oder ?
MfG John

pylon

Ein Array-Element wird über die eckigen Klammern "[]" zugegriffen und nicht mit den runden.

Johny_honda

Danke pylon Startschwierigkeiten ;-)
MfG John

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview