Some of the components you're going to need to realize this project will likely be quite pricy. Enough so that the cost of an Uno should not be a significant concern. Get one to use as your test bed for controlling individual parts. If you discover that you need more pins later for the complete controller, well, you'll have a spare Uno for another project.
I'd suggest you just concentrate on the sensor. Get rid of the LCD and write a simple sketch that echoes the state of the sensor to serial. To avoid serial slowing things down, probably best to only print when the state changes. If you're still getting sporadic results then, you'll need to work on your detection hardware.
The first error is simply a missing semicolon on this line:
int pin = 3
However, you're then trying to execute a pinmode command outside of any function. Take a look at the examples that come with the IDE and see how the setup and loop functions are used in arduino sketches.
Yes sir. Thank you. Those sites are all over the internet and tell us nothing about the Arduino. I would really like answers to my questions but thanks for responding.
Actually, it did tell you which board to select to use it with the IDE: Mega 2560. Plug in your FTDI cable and see if you can run a "Hello world" sketch that will send something to the IDE's serial monitor.
The LCD code is dodgy. You may be leaving digits on the screen from prior readings. Either clear the LCD or print spaces after the number. Frankly, I'd concentrate on the results from the serial port for now until you're convinced that the sensing is working.
The code looks fine to me - I don't see any advantage to using different constructs. The area I'd look at is how well your sensor is working - there seems to be quite wide variation in what it reads - or perhaps you got excited to see it finally working You might be able to mask that with a longer sensing period, but it looks like you need to compare what you're getting with a manual check of your pulse.