Here is an approach used by new learners to program an Arduino. Board is $ 3, Arduino Nano.
mBlock is application, you drag and drop blocks onto design canvas, config, and mBlock when you
are done generates C/C++ code for the Arduino. You can see that in right window. Kids in 6'th
grades on are using mBlock to program robots.
Here I have implemented functionality of Up and Down buttons, and then written data to LCD display.
Adding sensor to this quite easy as well. And maybe a button to initialize/reset the counts and display.
mBlock is free. There are a number of gui IDE/programmers like this, Flowcode, Snap4arduino, Scratch, NodeRed, each with common
capabilities as well as specific ones. Once you learn one the rest quite easy to use. Lots of videos to learn from. And you can as you
develop, look at C/C++ code generated to get an idea of what that looks like.
If you want to do IOT consider TUNIOT, web version free. That allows you to do all sorts of communications with phones and other PCs.
Its graphical also. An example for a different problem -
Had a problem where I need low cost Network, internet access, at a remote site. Choose to work with Verizon 8800L as it got good reviews for normal attended usage. Motivation was Cell internet only added < $ 20 to the monthly bill. Problems ...
www.electro-tech-online.com
I am doing an application now that uses ESP8266 to measure a Gas alarm detector and notify a person on their cell phone
if a problem at site exists, fire/gas leak....etc.. Tuniot and ESP8266 very versatile.
Regards, Dana.