motor_test.ino: In function 'void loop()':
motor_test:48: error: expected initializer before 'if'
motor_test:64: error: expected '}' at end of input expected initializer before 'if'
This is a circuit about controlling one motor with Bluetooth shield in the tow direction can u help me doing it.
The error message tells you which line the compiler doesn't understand. The error is usually a few lines before this. You have void loop() in there twice.
@uuemad : You need to understand how Serial communication works with the Arduino.
Do a google search for "Simple Arduino Serial communication tutorial" - get a good understanding of how that part works, and I think you will be able to move forward with your project.
Your logic is ok, but as michinyon stated - your syntax is not correct
thanks guys for your help and I'm sorry if i wasted your time in my project. (i start working with the arduino from two days ago so i still a beganer )
THANKS again
There are two basic parts to software code / programming.
Code / language SYNTAX and code flow.
Start with File>Examples> 01 Basic >BareMinimum
to get the base of your program and compile it .
It won't do anything visible but it will compile AKA the code will be of correct syntax ( computer language of sort) and the processor will understand it.
The code flow is very simple also - the processor will execute / run two functions - setup and loop.
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
When you get this program to compile use another IDE example File>Examples> 01 Basic >Blink.
That program follows same format as BareMinimum, so download it and compile it.
When it runs it will blink LED on you processor, hence you will have an indicator your program uses correct syntax ( it compiled) and its code flow is also correct- it does something ( visible).
Now when you get that working, come back here and we will rebuild YOUR program using correct syntax and figure out the flow together.