KeyDuino forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Un échange d'information autour de la carte KeyDuino
 
HomeHome  Latest imagesLatest images  RegisterRegister  Log inLog in  

 

 nfc_logger example

Go down 
2 posters
AuthorMessage
aleksander.kamenik
Newbie
Newbie



Messages : 3
Reputation : 0
Date d'inscription : 2016-03-10

nfc_logger example Empty
PostSubject: nfc_logger example   nfc_logger example EmptyThu 10 Mar - 15:13

Hi,

Tried the nfc_logger example, lib downloaded today and using Arduino Software 1.6.8.

The example was missing the #include "Keyboard.h". It looks a bit different from the video example.

While it does type the characters of the password, the \r and \n do not (which println() is sending). I tried adding them explicitly and they just don't show up while all visible chars do.

I also tried \t and it kinda works sometimes. Here's a screen shot showing it. The orange arrow is the tab character in Notepad++.

nfc_logger example Chars10

I simply held the tag near the reader for a several cycles. As you can see the tab got there only some of the times it registered. With \r and \n however the percentage is zero.

Also reading the Keyboard documentation I added the .begin() and .end() calls to the final if(), didn't help either. I later tried adding a delay(100) in front of the Keyboard.end() too, same behavior.

Any ideas?

Windows 10 64bit.
Back to top Go down
Ray
KeyDuino TEAM



Messages : 5
Reputation : 0
Date d'inscription : 2015-11-16

nfc_logger example Empty
PostSubject: Re: nfc_logger example   nfc_logger example EmptySun 13 Mar - 14:19

Hi Aleksander, and thanks for your post.

Sorry for the late answer, I'll only be able to look at it tomorrow, and then I'll answer you here.

For the moment, I can only tell you the Keyboard lib is different depending on your Arduino version.
We didn't really forget to include Keyboard.h, it's just that with my version, I don't need it!
But you're right, I'll add it to be compatible with most versions, thanks for the idea Wink

The result may be different with the OS too, the \t, \n, etc. always produce differents results.

Anyway, I'll look at it and keep you posted.

Regards,

Raymond
Back to top Go down
Ray
KeyDuino TEAM



Messages : 5
Reputation : 0
Date d'inscription : 2015-11-16

nfc_logger example Empty
PostSubject: Re: nfc_logger example   nfc_logger example EmptyMon 14 Mar - 10:22

Hey Aleksander,

So I just did my own tests on your problem, and I came up with some results.
You're right, with the newer version of Arduino, the Keyboard.println() doesn't add the "return" automatically.
I don't know why and that's a bit sad because you have to do it manually, as you noticed.

But I tried it on Linux, Windows and MacOS, and I had the three same results:
    * \n and \t always work
    * \r and \r\n never work

Which surprises me because I thought I remembered that \r\n was the best compatible option for different OSes.
Anyway, what strange is, is that I cannot reproduce your issues.

I committed the lib with the changes I made, but I'm not sure it will help you.
Don't hesitate to tell me if you experience any change.

Ray
Back to top Go down
aleksander.kamenik
Newbie
Newbie



Messages : 3
Reputation : 0
Date d'inscription : 2016-03-10

nfc_logger example Empty
PostSubject: Re: nfc_logger example   nfc_logger example EmptyMon 14 Mar - 12:10

I updated the lib and now the supplied example works. That is \n is interpreted as a newline, every time.

The login also works now.

However I discovered my testing in Notepad++ was tainted. It was the autocomplete that messed up the results! The autocomplete menu comes up and the first choice is chosen with the \n. This happens so quickly it's invisible.

The initial finding was correct that println was not printing the newline, however later testing with the explicit \n was wrong be cause of the autocomplete in Notepad++.

In summery, println is broken and autocomplete can be really sneaky.
Back to top Go down
Ray
KeyDuino TEAM



Messages : 5
Reputation : 0
Date d'inscription : 2015-11-16

nfc_logger example Empty
PostSubject: Re: nfc_logger example   nfc_logger example EmptyMon 14 Mar - 12:17

Oh yeah, I forgot to warn you! I had the autocomplete problem on the MacOS editor too ... ^^
For the println ... I guess we can't do anything.

Thanks for your feedback! Wink
Back to top Go down
Sponsored content





nfc_logger example Empty
PostSubject: Re: nfc_logger example   nfc_logger example Empty

Back to top Go down
 
nfc_logger example
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
KeyDuino forum :: KeyDuino informations & questions :: SOFTWARE questions & informations-
Jump to: