We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am controlling Arduino motors on Proteus with serial communication between Arduino and Processing. Signal is receiving on COMPIM Arduino, but the motor is not working. Just want you to check my programming that is their any fault in it.
Arduino Programming
int motor1pin1=10; int val=0; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode (motor1pin1, OUTPUT); }
void loop() { while (Serial.available()){ val=Serial.read(); } if (val == '1'){ digitalWrite(motor1pin1,HIGH); } else{ digitalWrite(motor1pin1,LOW); } delay(100); // put your main code here, to run repeatedly: }
Processing programming part
case UP: println("UP!"); fill(255,0,0); triangle(100, 440, 160, 440, 130, 400); myPort.write('1'); break;