Open ffd8 opened 4 years ago
Ahha.. found two problems!
/software
, the baudrate was set to 57600
whereas in the arduino code, it's set to 115200
...Tried changing some of the python scripts to use .encode()
on strings for unicode.. but then the actualTypewriter.py
script could only write one char before quitting with an error of: TypeError: a bytes-like object is required, not 'str'
Starting to play in Processing and successfully have really basic typewriter(!) without any bells/whistles using:
import processing.serial.*;
Serial myPort; // Create object from Serial class
int val; // Data received from the serial port
void setup()
{
size(200, 200);
myPort = new Serial(this, "/dev/cu.wchusbserial1430", 115200);
}
void keyPressed() {
if(keyCode != 16){
myPort.write(key+"");
}
}
void draw() {
if ( myPort.available() > 0) { // If data is available,
val = myPort.read(); // read it and store it in val
println(val);
}
}
Perhaps I'm making an amateur mistake... have the Nano + hardware all setup onan IBM 6747-2, but running into trouble while trying to test with your python scripts on MacOS 10.13.6, getting the following error (i'm using a nano clone, but that shouldn't be the issue, since code uploaded without problem):
Is it because I'm using python 3? (i'm not so familiar with python...) – also tried just your
testSend.py
, but get the following similar error:Do you know a solution? Have you considered making a basic demo for talking to the Nano controller via Processing?? That's more my strength.. have done serial for plotters + thermal printers.. so I'll explore that next, but curious if you already had any tests laying around to get started?