UDOO freeze on simple calculation

Discussion in 'Troubleshooting' started by ariadrianto, Feb 22, 2014.

  1. ariadrianto

    ariadrianto New Member

    Joined:
    Feb 22, 2014
    Messages:
    4
    Likes Received:
    0
    Hi All,

    I've bought UDOO dual. 8 Gb SD card and ubuntu 12.04.
    I'm using bluetooth mouse & keyboard, and it works. I write this using Udoo ubuntu browser.

    From internal ubuntu I've already install Arduino IDE.
    Trying blinking example, it works.

    and then I put HSM20G (humidity and temp sensor).
    Simple example reading analogRead , then output going into serial.... It Works.
    and now it's time to calculate from analogRead into human readable.

    Here 's my code :


    int sensorPin = A0;
    int suhuPin = A1;
    int ledPin = 13; // select the pin for the LED
    int sensorValue = 0, suhuValue = 0; // variable to store the value coming from the sensor
    float RH = 0;

    void setup() {
    // declare the ledPin as an OUTPUT:
    Serial.begin(9600);
    pinMode(ledPin, OUTPUT);
    }

    void loop() {
    // read the value from the sensor:
    sensorValue = analogRead(sensorPin);
    suhuValue = analogRead(suhuPin);
    // turn the ledPin on
    digitalWrite(ledPin, HIGH);
    delay(sensorValue);
    RH = (0.1515 * sensorValue) - 12.0;
    // turn the ledPin off:
    digitalWrite(ledPin, LOW);
    // stop the program for for <sensorValue> milliseconds:
    Serial.print(sensorValue,1);
    Serial.println(" Sensor");
    Serial.print(suhuValue,1);
    Serial.println(" Suhu");
    //Serial.print(RH,1);
    Serial.println(" %RH");
    //Serial.print(TinF,1);
    Serial.println(" F");
    delay(1000);
    }


    it always freeze on
    RH = (0.1515 * sensorValue) - 12.0;

    when I remark / delete this... everything going fine....

    Anybody knows what I missed ?
     
  2. ariadrianto

    ariadrianto New Member

    Joined:
    Feb 22, 2014
    Messages:
    4
    Likes Received:
    0
    Found the solution....
    Compile through another PC...
    and zap...
    It works...
     

Share This Page