Need help on averaging numbers for a project

hi peeps,

i’m looking for a way to average 5 value’s to a single number to start a calculation and then print it to an 16x2 lcd

i’"m making a beer color measure device for my homebrew club and the idea is that a 430nm led wil licht up 5 times and an ldr takes 5 reading than average the numbers and makes a calculation and prints the value on an lcd screen

any advice ? i don’t understand anything about computer code i’m just a simple welder

Hello and welcome.

Well, you need something like:

avg-measure-main

But, there’s no such node as avg-measure in XOD standard library (yet). No problem, you can make your own:

The basic idea is to trigger N readings and store their sum with count node. When N readings are accumulated, pass the result of the “sum / N” to the node output.

I didn’t check it for myself but hope I gave you the necessary direction. A xodball of the project is attached: lets-make-a-beer.xodball (7.3 KB)

thanks. i think i can add this to what i’ve got for the moment

i wanted to upload my project so far butt the forum won’t let me

here’s what i’ve got for the moment

test.xodball (5.6 KB)