Sorry, many of the things I mentioned in my previous posting and questions in your last posting are things that probably only you can answer as only you know what your goals are, the form of the data, and the desired results.
Some of my earlier questions like how are you going to connect the Nano? Was because I was thinking of Arduino Nano like:
https://www.newegg.com/p/2S7-003Z-0...cm_re=arduino_Nano-_-9SIA7BF2K18383-_-Product
I also wondered how it runs python scripts... Turns out from your last post it is a different beast. Which gives you several options on connections.
Obviously probably won't hook up Teensy using USB as you need the USB to plug into your PC... But it looks like it support Serial, I2C(Wire), and SPI... Not sure of any of the details, example: 3 Uarts? What type of connection do you have here? TTL or RS232 or ? What voltages?
Which Teensy to try? Personally I like the biggest and most powerful... But cheapest... Would be the Teensy LC, but personally I would start off with probably 3.2. Why? While it runs at 3.3v the IO pins are 5v tolerant. More memory, speed, faster Uart, ... If I were concerned that it did not have enough still maybe 3.5, but my guess is 3.2 would be a great starting place.
What would I try first? I would probably try to hook up the Nano by Hardware Serial port. On Teensy probably Serial1 or Serial2. How? depends? If it has a compatible Uart with appropriate software (Linux?) I Would try hooking it up that way... But Quick and dirty, I would maybe just get some USB to Serial adapter, example an FTDI cable or breakout board... And connect up the appropriate pins to the Teensy. TX->RX, RX->TX, and common ground...
Then on your Nano, you would need something in your Python script, I assume using PySerial, to output data in some format that decide on, from whatever inputs you are processing... On the Teensy side you would need to have code that reads in stuff from the Uart example Serial1... Where you do some code that receives the data (Serial1.read())... And then if your data says to do print something, it would then call Keyboard.print with that data...
Again those types of details are something you will need to experiment with. You might start off simple, and for example only try to output everything you receive from Serial1 and send it directly to keyboard...
Again something simple like:
Code:
void setup() {
Serial1.begin(115200);
}
void loop() {
while (Serial1.available()) {
int ch = Serial1.read();
Keyboard.write(ch);
}
}
And see if it talks OK...
Might try another similar simple test to see if I could talk like a mouse. It might be a little more complex as may need to encode information, like do you want a button press or release or do you want to move the mouse....
Then once you have something like that working, would look to how to combine. Develop a communication data format that you need to setup. Probably something with an ID to say keyboard or Mouse and maybe count of data? Maybe some form of standard header and/or checksum...
Again don't know you need or application. Things like how fast and/or how much... If too fast or much may need some form of handshaking, Which might be software and/or hardware...
Hope that gets you started.
Kurt