top of page

Raspberry Shake Raw Data Plotting and Alerting

Program


---

Raspberry Shake Raw Data Plotting and Alerting Program

This program uses the grsk command to get a fresh set of

readings from the Raspberry Shake and plots them.

---


prog_vars =

d/count 0

d/xpos 0

d/x_axis_ypos 300

-- Processed Sensor Values.

-- These ahve the offsets applied.

d/pro_EHZ 0

d/pro_ENE 0

d/pro_ENN 0

d/pro_ENZ 0

prog_vars.


prog_start =

pclear

d500

ptl 10 5 ^ts=24^tc=blue^ "Raspberry Shake Raw Data Program"

-- Add Quit Button

pb 25 50 ^n=Quit^p=exitprog^

prog_start.


prog_loop =

-- main program loop

inc /count

-- Stop agftwer 1000 readings

any /count >= 100000 -> exitprog

-- Get a fresh set of readings from the shake

grsk AM.R5C47

-- Apply Offsets to get Processed Values

sub /rs_EHZ 16000 -> /pro_EHZ

sub /rs_ENE -207461 -> /pro_ENE

sub /rs_ENN -287500 -> /pro_ENN

sub /rs_ENZ 3594472 -> /pro_ENZ

-- Plot EHZ, ENE, ENN

plot 0 75 ^id=rs^t1n=Z^t2n=E^t3n=N^xp=/xpos ^v1= /rs_EHZ ^v2= /rs_ENE ^v3= /rs_ENN ^

-- Display the plot value

ptl 30 45 ^ts=16^ "X /xpos > EHZ /pro_EHZ > ENE /pro_ENE > ENN /pro_ENN > ENZ /pro_ENZ "

any /pro_EHZ >= 50000 /pro_EHZ <= -50000 ->

ptl 25 1 ^ts=25^tc=blue^ "Tapapa Hopukina Kia mau"

else

ptl 25 1 ^ts=25^tc=Lime^ "OK"

enda.

-- Next Xpos

inc /xpos

-- Wait a while for next readings

d500


prog_loop.

prog_stop =

ptl 525 5 ^ts=100^ "Bye"

prog_stop.




bottom of page