shiftin example very slow

Hey everyone!

I have hooked up the shiftin tutorial, http://www.arduino.cc/en/Tutorial/ShiftIn and it works great, I uploaded the hello world code and it reacts to my button presses. My goal is to couple the input to LED's lighting up( kinda like the monome) but the reaction time from the button press to the console outputting a byte order seems quite slow, 500ms at least. I have changed the baud rate to the high 115200 yet it still seems slow to react. Looking at the code i know there are a few delays i could bump around but I wanted some help on whch to modify...since when i have lowered them all to 5 ms it still feels very slow when the console reports.

Id love some code or any ideas...perhaps the console is a bad method to show the reaction of button presses?

bendji

Try to use a LED as an indicator in stead of the Serial monotor.

This should tell you if it is the serial communication, or the associated commands that is slowing things down.

thanks ill try it out!

well i figured it out! thanks for the obvious led idea(duh i need to think a little harder next time) anyways doing the led visual check let me figure out the problem why everything was so latent.

after messing around with a bunch of the delays in the shiftin tutorial i noticed that the hello world code showed delaymicroseconds(0.2), though it should be a real number no some decimal of a microsecond(found this out from the reference.) delayMicroseconds need to be at least 3 to be accurate, with a .2 microsecond it was throwing everything off.

thanks everyone.

Hi, thanks for letting us know about that. I changed the example to delayMicroseconds(2). Can you see if the revised code works properly?

in the docs it says 3 seconds is the minimum. Yeah ill totally try it out. thanks for the fix.