Float Berechnung


hallo zusammen,

folgendes stück code treibt mich gerade zur verzweiflung:
code: [select]
   
    bassval = expsensval2 * 1.30;
    if ( sensvalfloat > bassval){
      digitalwrite(led, high);
      previousmillis = currentmillis;
      schmier1 = sensvalfloat;
      schmier2 = bassval;
      schmier3 = expsensval2;
    }


wenn ich mir meine schmier-merker später seriell ausgeben lasse kommt zum beispiel folgendes ergebnis:

755.00
739.27
739.27

bassval ist immer gleich expsensval2. das * 1.3 wird anscheinend nicht ausgeführt. hat jemand eine ahnung warum? die variable bassval wird als float ganz anfang als globale variable deklariert, und sonst nirgendwo verwendet. ich verstehe es gerade nicht.

grüße,

sven

code: [select]
bassval = (float)expsensval2 * 1.30;
bitte testen


Arduino Forum > International > Deutsch (Moderator: uwefed) > Float Berechnung


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support