Announcement

Collapse
No announcement yet.

Issue with sonar.ping()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Issue with sonar.ping()

    I have a sketch that I am working on and when I upload to the Uno and try and connect to HS it fails.

    I have it traced down to the Line: int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).

    If I comment that out it works. I am not sure why. I have attached the sketch and the debug file.

    I had it working before, but it would basically do one read from the sensor and then stop.
    Attached Files
    Kirk

    http://cleverhouseautomation.ca
    http://southcoastwebsitedesign.ca

    #2
    Just had a quick look over and it could be the following:

    Comment out the two lines above: drive_state = digitalRead(drive_pin);

    Code:
     LastReportedDistance = distance;
    LastReportedPercent = percentage;
    to be
    Code:
     //LastReportedDistance = distance;
    //LastReportedPercent = percentage;
    as I think this will set this on every loop and flood the plugin.

    Give it a go and see.

    Greig.
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment

    Working...
    X