What could replace 'NULL' in this situation

Hello i wrote some code it works well but when i complle it
warnings are appeared

home/jarvis/Dropbox/ARDUINO/_1_Motor_control/_1_Motor_control.ino:132:67: warning: passing NULL to non-pointer argument 2 of 'void digitalWrite(uint8_t, uint8_t)' [-Wconversion-null]
** else if(A == 78){myservo.write(45); digitalWrite(Motor_dir, NULL); analogWrite(Motor_pwm, 0); digitalWrite(Motor_brk, HIGH);} // HL50**

like this
I did this because Motor_direction's options are LOW or HIGH (I think,,,,?)
so in this case I want no argument is hung on this value

I'm not very good at English
so this may sounds awkward..but please help me :slight_smile:

Why call the function if you don't want to send a value?

NULL should be used strictly for pointer contexts.

kosh09:
I did this because Motor_direction's options are LOW or HIGH (I think,,,,?)
so in this case I want no argument is hung on this value

What do you mean you want no argument? That's not an option. You either write the pin LOW or HIGH. There aren't any other options for digitalWrite. Anything that evaluates to 0, like your NULL for instance, will be cause the pin to write low and anything else will cause the pin to write high.

What are you trying to accomplish here?

digitalWrite(Motor_dir, NULL);

Why write anything to Motor_dir ?

Maybe it is the wishful try to stop the motor?

When the direction (of movement) is neither forward nor backward?

Whandall:
Maybe it is the wishful try to stop the motor?

When the direction (of movement) is neither forward nor backward?

I think your opinion is most similar one
Of course I write pwm as 0 and enable break either but i want to be there is no direction
I'm not a professional but this is wrong code?
but If I use motor drive that has no break pin, analogWrite(pwm,0) could be enough?

If a motor is stopped, the current direction does not really make a difference, does it?

Yes, but the speed could be negative zero. That might be important.

Dude, argument 1 is the pin number, argument 2 is what you want to write (LOW or HIGH) to the pin.

digitalWrite(Motor_dir, NULL);

doesn’t do much if Motor_dir is the value to be written.

well my point is if Motor drive that has no break pin
even I write 0 to pwm pin it will slow down slowly not going to stop immediately ( I think?)
so I try this way

I save the state of current dir state at the end of the function as
Curr_dir = digitalRead(dir);
and when I want to stop the car
I wrote

 analogWrite(pwm,0); digitalWrite(dir, !Cruu_dir);

but I made this car remote controlled by bluetooth
and I think above process maybe slow down the bluetooth receiving process
(actually I use odroid and arduino, odroid receive data via bluetooth and odroid send that data to arduino
via usb serial cable)

If that phrase doesnt makes code slow down that code could be the answer
how do u think?