Hi All,
I was wondering if anyone has seen this issue with using RAW HID and the Arduino Serial Monitor and trying to send characters through it. I get an error from the IDE. The Teensy prints to the Serial Monitor fine though.
The code that is compiled on the Teensy 3.2 at 96 MHz is this:
And the error that comes up when I try to send characters to through the Serial Monitor is this:
The Arduino Serial Monitor won't even try to send them it seems, I don't remember this being a problem from before? This fresh install of both Arduino and Teensyduino, I have restarted the IDE many times so I don't know what else to try?
I was wondering if anyone has seen this issue with using RAW HID and the Arduino Serial Monitor and trying to send characters through it. I get an error from the IDE. The Teensy prints to the Serial Monitor fine though.
The code that is compiled on the Teensy 3.2 at 96 MHz is this:
Code:
elapsedMillis time;
int count;
bool stop;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(230400);
Serial1.begin(230400);
time = 0;
count = 0;
stop = false;
}
void loop() {
if (time > 20 && !stop) {
Serial1.print((char)0x00);
//Serial1.print((char)0x00);
//Serial1.print((char)0x00);
//Serial1.print((char)0x00);
//Serial1.print((char)0x00);
Serial1.flush();
delay(2);
Serial1.printf("Hello, Count: %i\n", count++);
digitalWriteFast(LED_BUILTIN, HIGH);
Serial1.flush();
digitalWriteFast(LED_BUILTIN, LOW);
time = 0;
}
if (Serial1.available()) {
char c = Serial1.read();
Serial.print(c);
time = 0;
}
if (Serial.available()) {
char c = Serial.read();
if (c == 's') stop = true;
if (c == 'r') stop = false;
Serial.print(c);
time = 0;
}
}
And the error that comes up when I try to send characters to through the Serial Monitor is this:
Code:
Build options changed, rebuilding all
Sketch uses 34,276 bytes (13%) of program storage space. Maximum is 262,144 bytes.
Global variables use 4,884 bytes (7%) of dynamic memory, leaving 60,652 bytes for local variables. Maximum is 65,536 bytes.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at processing.app.Serial.write(Serial.java:191)
at processing.app.Serial.write(Serial.java:211)
at processing.app.TeensyMonitor.send(TeensyMonitor.java:95)
at processing.app.TeensyMonitor.access$100(TeensyMonitor.java:36)
at processing.app.TeensyMonitor$2.actionPerformed(TeensyMonitor.java:72)
at javax.swing.JTextField.fireActionPerformed(JTextField.java:508)
at javax.swing.JTextField.postActionEvent(JTextField.java:721)
at javax.swing.JTextField$NotifyAction.actionPerformed(JTextField.java:836)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1663)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2882)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2929)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2845)
at java.awt.Component.processEvent(Component.java:6312)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:806)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:1074)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:945)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:771)
at java.awt.Component.dispatchEventImpl(Component.java:4762)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)