Hello,
I am working on a project with an end goal of a personal project and also to learn along the way. I am stuck on finding a reasoning behind the following results.
Scenario:
I currently want to use the digitalRead of the Arduino to read the Data +/Data - line of my USB keyboard and digitalWrite to output to a logic analyzer (later on this will output to some kind of system that can parse keystrokes).
My set up is as followed:
Wired keyboard (Data +/-) >> Arduino digital pins 8 and 9 as input >> Arduino digital pins 10 and 11 as output >> 2 channels on my logic analyzer
Note about the wired keyboard. It is connected to another device so it has voltage and ground already. I have spliced the Data +/- lines to my Arduino.
Now I can read the Data lines on my keyboard via the Logic Analzyer alone at 4MHz and parse out the information I need. The end goal is to have the Arduino parse this differential signaling and pass it to other devices. I want to use the logic analyzer for now to make sure the Arduino is getting the correct information needed to replicate.
The issue is when I review the results of the logic analyzer, its crazy! Differential signaling is not there and the HIGH and LOWs appear random.
Here is my code on the Arduino:
int Pin = 8; // Initializing Arduino Pin
int Pin1= 9; // Initializing Arduino Pin
int Pin2 = 10; // Initializing Arduino Pin
int Pin3 = 11; // Initializing Arduino Pin
void setup() {
pinMode(Pin, INPUT); // Declaring Arduino Pin as an Input
pinMode(Pin1, INPUT); // setting next pin to read
pinMode(Pin2, OUTPUT); // Declaring Arduino Pin as write
pinMode(Pin3, OUTPUT); // setting next pin to write
}
void loop() {
if(digitalRead(Pin) == HIGH)
{
digitalWrite(Pin2, HIGH);
// delay(waitTime);
}
if(digitalRead(Pin) == LOW)
{
digitalWrite(Pin2, LOW);
}
if(digitalRead(Pin1) == HIGH)
{
digitalWrite(Pin3, HIGH);
}
if(digitalRead(Pin1) == LOW)
{
digitalWrite(Pin3, LOW);
}
}
Any recommendations of libraries to look at or roadblocks I might run into.

