To make it clear I think the problem is not with the code or the wiring the electronics components. It must be something else.
Python code:
Code: Select all
import RPi.GPIO as GPIO
from time import sleep
try:
GPIO.setmode(GPIO.BOARD)
Motor1A = 16
Motor1B = 18
Motor1E = 22
GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
GPIO.setup(Motor1E,GPIO.OUT)
while True:
print "Raboti"
GPIO.output(Motor1A,GPIO.HIGH)
GPIO.output(Motor1B,GPIO.LOW)
GPIO.output(Motor1E,GPIO.HIGH)
except KeyboardInterrupt:
print "Stop"
GPIO.output(Motor1E,GPIO.LOW)
GPIO.cleanup()
Code: Select all
#include <iostream>
#include <wiringPi.h>
using namespace std;
#define Motor1A 16
#define Motor1B 18
#define Motor1E 22
int main()
{
//if(wiringPiSetup()==-1)
//{
// cout<<"Setup wiring pi failed";
// return 1;
//}
wiringPiSetupGpio();
pinMode(Motor1A,OUTPUT);
pinMode(Motor1B,OUTPUT);
pinMode(Motor1E,OUTPUT);
for(;;)
{
printf("OK");
digitalWrite(Motor1A,HIGH);
digitalWrite(Motor1B,HIGH);
digitalWrite(Motor1E,LOW);
delay(5000);
digitalWrite(Motor1A,HIGH);
digitalWrite(Motor1B,LOW);
digitalWrite(Motor1E,HIGH);
cout<<" After 5 sec "<<endl;
}
return 0;
}
I've tried with * gpio readall * and when i send signal to these pins, the value should be changed to 1, but in my case it isn't. If you have any questions or suggestions please let me know. I need to know if they're permanently damaged or not.