Hi guys, I'm trying to make a bit bang serial connection through mega328 and Arduino seems to lack speed as the connection never happens. Here is the code, so you can better understand what I'm trying to do:
boolean pc2vr;
boolean vr2pc;
void setup() {
// PC UART Init
pinMode(0, INPUT); // sets the digital pin as input
pinMode(1, OUTPUT); // sets the digital pin as output
// VRbot UART Init
pinMode(3, INPUT); // sets the digital pin as input
pinMode(2, OUTPUT); // sets the digital pin as output
}
//================================================================
// Main Loop
//================================================================
void loop(){
pc2vr = digitalRead(0);
digitalWrite(2, pc2vr);
vr2pc = digitalRead(3);
digitalWrite(1, vr2pc);
}
//================================================================