Skip to content

rainmeter.cpp is wrong #14

@t3hoe

Description

@t3hoe

Hello again,

the rainmeter.cpp Version 1.5 provides incorrect values, accept the 24h amount.
The determination of the values from the array is wrong. When you write into the array foreward, you must read backward for calculating e.g. the last hour (see line 118 to 125).
My way to do this is:
for(uint8_t i=0;i<valuecount;i++){
if (startidx > 0){
startidx--;
} else{
startidx = ( sizeof( RainAmount24h ) / sizeof( RainAmount24h[0] ) ) - 1;// 1st index is 0!!!
}
rainpulses+= RainAmount24h[startidx];
}
Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions