LCD + Sound + Pressure + OH = Breathalyzer?

this is exactly the kind of thing im looking for

currently in the process of starting a college project of making a breathalyzer
im in charge of the lcd display and a sound indicator (indicates the when pressure is at desirable rate)
another lad is doing a pressure indicator (ensure the user is blowing at the right rate)
and another fella is doing the alcohol sensor (which will give inputs and be displayed on the lcd screen)

these start off as individual projects and then all have to be tied together
my part rely's on the input of the other 2 so at the mo im using potentiometers to simulate the inputs but ive only been messing around with the arduino for about 3 weeks and trying to get my head around how to get everything running smoothly together is a bit of a brain melt

for instance i have a speaker play a continuous note for input between 400 and 800 (pulled these values out of thin air) which is handy enough, just throw a delay of 10 on the end and it will continuously check the input values however i want the speaker to make a double high note if the input goes over 800. However with just the delay the high note is play continuously and sounds like a smoke alarm :cold_sweat:

not exactly what i wanted was thinking maybe if i made the whole thing have to be initiated with a button push and have the readings taken over a 5 second interval where if the input goes over the double beep sounds and the process has to be started over with the button needing to be pushed again it might solve this because it wouldn't be relying on the constant loop to check on the inputs (if you get what im on about)

how and ever getting my head around the code is a bit of nightmare especially with multiple inputs

for instance at the min ive been trying to make a push button start playing the mario theme tune on a speaker and stop immediately when released, first part works but when the button is released it continues to play until the end of theme, tried using a while function to say whilst tune is playing if button read is HIGH then noTone except now what i get is the tune playing straight away (at a weird slow tempo for some reason) and when the button is pushed (ie read LOW) it pauses the theme

alot of hmmmmm'ing going on and with tutorials teaching one thing and getting it is great but applying it to another is completely different

sorry for the long reply, guess what im trying to say is thanks. Ive downloaded the code, i dont have servo's so im going to see can i get the speaker to do something in it's place

also any advice on an approach to any one of my current issues would be great :smiley:

evancleary:
also any advice on an approach to any one of my current issues would be great :smiley:

Without seeing your code I can only guess but from your description I guess you have used a blocking architecture so your sketch can only do one thing at a time. The non-blocking architecture that Robin2 is demonstrating is going to work far better for your project.

Moderator edit: tidy after splitting

that seems to be the plan
when i have got more done il post it up
here's hoping