Help with sketch for a seat counter. Complete newbie :)

Hello lovely people of the internets.

I am not new to using arduino's but i am very new to having to actually code them. Usually I just install them already programmed but this time I need to come up with a sketch aswell.

The model I have is a arduino ethernet and I want to programme it to be a simple seat counter.

I have got hold of some deadman switches similar to those used in forklifts, just simple contact pads. The plan was to install this inside the padding of a seat and then have a sketch running that counts how many times the seat is used and then firing the count over the network at the end of each day.

Obviously there will have to be bits in the code to stop repeat counts (shuffling on seat).

Sorry for this slight cry for help. Hope you dont mind!

Adam

Why not have the Arduino acting as a web server, so you can view the totals in (near) real-time?

Have you played with any of the samples sketches in the IDE?
They're a great way to get started, reading switches, performing tasks at intervals and basic ethernet / web tasks.

Yes I have just downloaded the Arduino software and have been looking at the samples that come with it. The physical side of it makes sense to me, soldering and connecting hardware im fine with. Its just when it comes to code i start getting scared hahaha

Basically im after help with a simple sketch. That makes the arduino ethernet work and sends a simple udp packet everytime the contact switch is pressed. :slight_smile:

May sound simple to you guys but im brand new to this :slight_smile:

What one of the examples in the software is closest to what im trying to achieve?

I Have got as far as having the arduino set up and mac address works etc. I can see it on my DHCP table.

I now need to add the loop section of code to send a udp packet (seatpress) every time the contact closure is triggered also with some kind of debounce in there... any ideas :slight_smile:

Thanks for any help

Ad