My Tide Vane Project


my project determine whether tide rising or falling in real time using ping sensor , looking @ last ten minutes of height change. either or arrow of leds or down arrow result.  statements within loop require 2d array of ten rows , 3 columns. first column height measurement, second column difference between oldest height measurement 9 minutes ago , new measurement. third column +1. or -1. , sum of determine rising or falling direction. assumption ten minutes enough time accurate measurement in mid-tide range tide significant.
to achieve 1 minute delay between measurements plan include 4 15,000 millisecond delays total 1 minute.
i believe have declare 2d array , populate data through first ten minutes.
int myarray [10][3] = {6.1,+.3,+1.;6.1,+.3,+1;6.1,+.3,+1;6.2,+.2,+1;6.2,+.2,+1; 6.3,+.1,+1;6.3+.1+1;6.3,+.1,+1;6.4,+0.,+1;6.4,+.0,+1}
make new measurement of h, height of device above water surface, 5.2. compare oldest data point 6.4. difference 6.4-5.2=1.2  . because sign positive, third element of array row +1 .  new incoming row incoming (5.2,1.2,+1)
now must manually reorder array add new value
lastrow [9] = lastrow [8]
lastrow [8] = lastrow [7]
lastrow [7] = lastrow [6]
lastrow [6] = lastrow [5]
lastrow [5] = lastrow [4]
lastrow [4] = lastrow [3]
lastrow [3] = lastrow [2]
lastrow [2] = lastrow [1]
lastrow [1] = lastrow

  • lastrow
  • = incoming row

    the final use of data sum third column in case +10. intended light arrow 1 minute. since 4 15 second delays included in steps of statement loop complete , can go new measurement.
    i need writing code handle array described. if have code elements or can me in appreciate it.

code: [select]
int myarray [10][3] = {6.1,+.3,+1.;6.1,+.3,+1;6.1,+.3,+1;6.2,+.2,+1;6.2,+.2,+1; 6.3,+.1,+1;6.3+.1+1;6.3,+.1,+1;6.4,+0.,+1;6.4,+.0,+1}
be sure let know how storing floats in int array works you. not going guess.

that not how initialize 2d array, way.
three separate 1d arrays make life 1 whole lot easier. that's 1 in int value...


Arduino Forum > Using Arduino > Project Guidance > My Tide Vane Project


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support