expression cannot be readen as fuction

hi i make a program for adruino and rain sensor that when the rain sensor finds rain to press a button on my keyboard (i want my arduino act like a keyboard) and it shows me the message expression cannot ve readen as fuction

thats my code


  • Arduino Rain Sensor Alarm
  • Realized using a pre-wired rain sensor module
  • Author: T.K.Hareendran
  • Prototyped &Tested at Technode Protolabz /1:04 AM 7/26/2015
  • Source:
    int rainSensePin= 0; // analog pin 0 - sensor i/p
    int alertPin= 8; // digital pin 8 - alert o/p
    int curCounter= 0; // current counter - goes up by 1 every second while sensing

void setup(){
pinMode(alertPin, OUTPUT);
pinMode(rainSensePin, INPUT);
void loop(){
int rainSenseReading = analogRead(rainSensePin);
delay(250); // relax

if (curCounter >= 30){
digitalWrite(alertPin, HIGH);

if (rainSenseReading <300){
else if (rainSenseReading >300) { // if not raining at threshold level
digitalWrite(alertPin, LOW); // don’t raise an alert
curCounter = 0; // reset the counter to 0

if (rainSenseReading <300()) {;


 if (rainSenseReading <300()) {

The parenthesis after 300 mean that you are trying to call a function named 300. A function or variable name cannot start with a number. Get rid of those parenthesis.

Compare a correct one

if (rainSenseReading <300){

with what the compiler is complaining about

if (rainSenseReading < 300()) {

What needs to happen when the sensor reading is equal to 300; you don’t handle that option in the below

 if (rainSenseReading <300){
  else if (rainSenseReading >300) { // if not raining at threshold level

Which Arduino are you using? The Keyboard functionality is only available on Arduinos with a native USB port (e.g. Micro, Leonardo).

And please read How to use this forum - please read, specifically point 7 about posting code.

i am using arduino uno and also sorry i will post right from now

You can edit your opening post, put [code] before your code and [/code] after your code.

A standard Uno can not act as a HID; there are articles on the web how to hack it. It's probably easier to buy one of the boards that I mentioned.