Hey everyone, I have a project due soon and I decided I would make a soil moisture sensor that lights a led to show if the moisture is good, now I want to add this [int percentagemoisture = map(moisture, 1024, 0, 0, 100);] to the code below but when I upload it it says primary expression expected before the ? token, how can I add the above integer to show as percentage?
DeanWin1:
Thank you, it did work, however I have one last question, how hard is it to add an LCD to this
Going to depend a bit on what kind of LCD you are going to use, since displays can be directly driven by the Arduino board, or use other interfaces such as I2C or SPI.
Here is some example code and how to connect an LCD display, get it working then adapt your code to display to the LCD.