Mixing 2 codes!

Hey,

I got working some old project code and want to use a little bit different sensors (HC-SR04). I know that people had got them working.

So I got lights system code named “trepp” and other code named “sensors”. I have to change code in “trepp” so I could use 2x sensors and they work same as should work PING sensors.
Please help me to the right track so I could finish this project :frowning:

There’s 2 sensors - When first one sees someone, lights are going on smoothly to the up same time as person walks up. Upper sensor sees person walking throught and lights are going off again. Like this - - YouTube

Thanks for helping,
Mark

trepp.ino (8.01 KB)

sensor.ino (1.84 KB)

The NewPing library works with HC-SR04.

But I have to change something in code because my brain has switched off with all that coding stuff :smiley:
If you could give me the hint of success, I would be really happy :slight_smile:

Here

But I have to change something in code because my brain has switched off with all that coding stuff

Sorry but switch your brain on again. No one is going to write your code for you, but we will help you fix it.

Check the link below on how to combine two sketches.
https://arduino-info.wikispaces.com/CombiningArduinoSketches

So I think I got the code thing OK.. Now I have to connect all wires like the code.. Right? :smiley:

I got Micrel MM5450YN 1222 chip, 2x (4pin) HC-SR04 sensors, 15 LED's (code was for 9, will use 9 first for testing), Arduino UNO and a bunch of wires. Do I need anything more or it should work?

Original scheme, code - Automated LED stairs | NovoKane

She uses Pro Mini plate so it's a little bit confusing. I added picture, maybe you can help me a little :slight_smile:
NB! bottomPingInputPin = 5 & topPingInputPin = 8

Mark