|
Author |
Topic: serial send bytes faster with mousebutton in use? (Read 1855 times) |
|
blub Guest
|
serial send bytes faster with mousebutton in use?
« on: Dec 6th, 2004, 1:31pm » |
|
Hi, I am not sure, but I wan't to notify some kind of strange phenomon (maybe software-bug?). Although I made it v67. the serialWrite() is putting out bytes faster when the mousebutton is pressed or used. I noticed thiw kind of behaviour with a steppermotor and the following code: Code: byte[] off = { 0 }; byte[] s = { 1,3 }; byte[] t = { 2,3 }; byte[] e = { 2,4 }; byte[] p = { 1,4 }; int time= 5; void setup() { //using a FTDI-232 for communication to PIC (baudrate = 115200) beginSerial(115200); } void loop() { //write bytes to PIC, used for pin 1 and 3; step 1 for motor. serialWrite(s); //time to not overflow my serial_buffer at the PIC-side delay (time); //write byte = 0 to PIC, used to set pin 1 and 3 off.. serialWrite(off); //go to next step... serialWrite(t); delay (time); serialWrite(off); serialWrite(e); delay (time); serialWrite(off); serialWrite(p); delay (time); serialWrite(off); } |
| Has anyone noticed this before, is my way of coding not ok? and does somebody have another way to control a stepper? Thanks in advance! Erik
|
« Last Edit: Dec 6th, 2004, 1:32pm by blub » |
|
|
|
|
TomC
|
Re: serial send bytes faster with mousebutton in u
« Reply #1 on: Dec 6th, 2004, 1:44pm » |
|
Is it a serial mouse? (Or maybe a USB-serial interface and a USB mouse?) I used to have a conflict with my modem and mouse, and the only way I could download at 56k was to keep the mouse moving! Maybe it's a simple conflict like that? Have you tried a different port?
|
|
|
|
blub Guest
|
Re: serial send bytes faster with mousebutton in u
« Reply #2 on: Dec 7th, 2004, 1:14am » |
|
on Dec 6th, 2004, 1:44pm, TomC wrote:Is it a serial mouse (Or maybe a USB-serial interface and a USB mouse) Maybe it's a simple conflict like that Have you tried a different port |
| Thanks for the reply...and a answer... This is my fault by using the word "mouse".. I'am wrong by saying mousebutton is used or pressed down, when i use a laptop (G4 Pb) with a trackpad.. So when I use a trakcpad and press the trakcpad-button this phenomon occurs... So probably it's not a conflict and I think the serial-protocol works fine, although it is working faster when you press the trackpad...but would be nice not to push your trackpad the whole time..to have such speed of serial_communication. Are there some more suggestions Thanks in advance! Erik
|
|
|
|
|