I know nothing about programming yet I need to solve this problem within the next 10 days

There is a proximity sensor and I need to figure out how to write a program that counts how many objects move past it. Where the FUCK do I even begin with something like this? I barely know what programming is, I don’t want to get into why I need to do this but let’s just say I’m in over my head a little bit.

Attached: 1D20D0C2-C775-4172-A4AF-B0B398E607E7.png (224x225, 7K)

Other urls found in this thread:

ia.omron.com/data_pdf/guide/41/proximity_tg_e_6_2.pdf
twitter.com/NSFWRedditVideo

good luck! and most importantly have fun.

What? Please...help me...

you haven't shared enough information.
just told us about some ominous proximity sensor that is there.

Objects on a conveyor will blocking past a proximity sensor. I need to somehow write a program that counts how many objects have went past the sensor, it’s an inductive proximity sensor. That’s literally the extent of what I know, I don’t even know what details you would need from me because I have no clue how to do any of this. I’m so fucked, so so fucked. I might just catch a bus across the country and change my name.

int countObjects(Sensor sensor){
int count = 0;
while(sensor.isActive()){
if(sensor.sensesObject()){
++count;
}
return count;
}

find the sensor model
find its documentation online
read how to interface with it

Get a fucking new job OP, you’re fucked

Is it really that simple?
I only know some bash scripting, and I came up with this same solution.

What is “sensor.isActive”?

Google the model of the sensor and look for documentation.
Your needs sound so basic I'm willing to bet they have code examples in the manual you can copy-paste to get it to do exactly that
Here's what you need to do
> Look for the documentation
> Read it
> Find out how it interfaces with a PC and how you can receive the data it sends
> Write a simple program to write a counter to either a database or a file

Is this a theoretical assignment or a live one?
If its theoretical -> just name functions whatever you want
if its live -> buy a microcontroller like an arduino -> find the name of the proximity sensor and google example code that might likely have this already.

for logic its just
default_distance = readSensor() (when it turns on it zeros out)
threshold =10 units
counter=0

func Main(){
if (threshold>default_distance-readSensor())

counter++;
}

10 days is enough

A method of the Sensor class that presumably returns an integer

This.
Are you having fun OP?

it's just pseudocode. You need to look up the library for the specific sensor and see what methods are available, but that's the basic logic

Thank you gentlemen, I’m going to look into finding documentation for the specific sensor. As for the specifics on why I need to do this and how I got put in this situation, let’s just say I was a NEET loser who took “fake it till you make it brah” a bit too far...there’s a nice story there but that’s probably for another thread. I’m afraid if I told the story it would derail the thread too much and I wouldn’t get any more helpful comments.

What's this gonna be used for? I don't wanna die on an airplane cause some NEET loser lied on his resume and pasted Jow Forums code into the production code for an AoA sensor

Tell story
This

I am not the OP but I can almost guarantee this is for a PLC in a warehouse.

ia.omron.com/data_pdf/guide/41/proximity_tg_e_6_2.pdf

Things front sensor high value, no thing 0.
loop sensor.

>I’m afraid if I told the story it would derail the thread too much and I wouldn’t get any more helpful comments.
well too late.
story time.

Attached: 1557451885303.png (854x412, 526K)

Post story

this, I'll help if you post story and the sensor and the preferred language