I have a problem when I'm trying to send/receive data across serial port on raspberry Pi 2 ... I used Arduino Mega and AUNO as well also I tried nanpy library it worked slow too
python code :
import serial
from time import sleep
ser = serial.Serial('/dev/ttyACM1', 9600)
while 1 :
a= ser.readline()
ser.write('5')
print (a)
Arduino Code :
void setup()
{
Serial.begin(9600);
for (int i=2;i<=13;i++){
pinMode(i,OUTPUT);
}
}
void loop()
{
Serial.println("Hello Pi");
if (Serial.available()>0) {
for(int i=2;i<=13;i++){
analogWrite(i,255);
Serial.print (Serial.read());
} } }
Help please this is the last step to finalize my code for the project :'(
Thanx