Go Down

Topic: new to this, using copied code, getting errors (Read 531 times) previous topic - next topic

OldSteve

No, my name comes from the symbol for the change in Gibbs free energy.  I'm a chemist by trade.
Ah right. I've learned something new. :)
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

allanhurst

Quote
Unlike the earlier TTL circuitry, which will stay low unless a voltage or pullup resistor is applied to turn on the input transistor.
I seem to remember that standard TTL inputs were floating emitters of a NPN BJT with the base tied high, so if unterminated appeared as a 'high'

Allan

OldSteve

I seem to remember that standard TTL inputs were floating emitters of a NPN BJT with the base tied high, so if unterminated appeared as a 'high'

Allan
Oops, I was a bit rushed. I actually meant transistor inputs, not TTL. (I was referring to the base of a transistor.)
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

coasterp

Have another question. Been googling but can't fine the answer. I am getting a message "Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?" when I upload to my Arduino. I can not figure out why or how to fix this. Again, any help is greatly appreciated.

slipstick

Post the latest version of your code. The last version I saw included that line and if it still does you shouldn't be getting that message. Also post the FULL error listing. Among other things it will tell you exactly where in the code the error occurs.

Steve


coasterp

#20
Nov 14, 2017, 09:20 pm Last Edit: Nov 14, 2017, 09:39 pm by coasterp
Post the latest version of your code. The last version I saw included that line and if it still does you shouldn't be getting that message. Also post the FULL error listing. Among other things it will tell you exactly where in the code the error occurs.

Steve


I am using the code that pert put into the box in their reply early in the thread. That is also the full error code message. I cut and pasted directly into here. When I do the upload it actually highlights that specific line in orange. If you need more info, let me know and I will get whatever you need. Can even do a video if needed.

slipstick

Is this the first time you've ever tried to compile that code after all this time? What Arduino are you trying to compile it for? It won't work for them all.

Steve

Delta_G

That is also the full error code message. I cut and pasted directly into here.
No, the compiler puts out a whole bunch of stuff when you press the compile button.  No way it was just one line.  Copy and paste the whole thing.  You may have to scroll the window to see it all. 
If at first you don't succeed, up - home - sudo - enter.

coasterp

No, the compiler puts out a whole bunch of stuff when you press the compile button.  No way it was just one line.  Copy and paste the whole thing.  You may have to scroll the window to see it all. 
You are correct. I expanded the lower window and this is the whole message:

C:\Users\Phil\Desktop\scoring\scoring.ino: In function 'void loop()':

scoring:33: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
     Keyboard.begin();

     ^

exit status 1
'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

 

Delta_G

There was even more than that.  Scroll up.  It's a whole bunch of stuff.   
If at first you don't succeed, up - home - sudo - enter.

coasterp

Is this the first time you've ever tried to compile that code after all this time? What Arduino are you trying to compile it for? It won't work for them all.

Steve
I tried after originally posting but got pulled into higher priority projects. Just getting back to this. This is used on a Leonardo but I was trying to use it on a Uno and Arduino knockoff I got locally. The knock off is a Velleman ATmega32u4 LEONARDO. This was all I could get locally very quickly. If a Arduino Leonardo is needed for this, then I will order one. Again, no experience in this area so I just figured code going into a micro-processor would work.

coasterp

There was even more than that.  Scroll up.  It's a whole bunch of stuff.  
I hit the Copy error messages. You are correct. This is what I am able to paste:

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Phil\Desktop\scoring\scoring.ino: In function 'void loop()':

scoring:33: error: 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
    Keyboard.begin();

    ^

exit status 1
'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Delta_G

so I just figured code going into a micro-processor would work.
The code is sometimes very specific to features on a specific microcontroller.  In the case of the Keyboard library is only works on 32u4 based boards.  If you'd read the documentation for the library it says so in the first few sentences.  
If at first you don't succeed, up - home - sudo - enter.

Delta_G

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"
Yup, there it is.  Keyboard won't work with an UNO. 
If at first you don't succeed, up - home - sudo - enter.

coasterp

The code is sometimes very specific to features on a specific microcontroller.  In the case of the Keyboard library is only works on 32u4 based boards.  If you'd read the documentation for the library it says so in the first few sentences.  
I don't even have a clue what this library you're talking about is. I will do some research on it. I also have a book on writing code for these. I have not really looked at it due to be tied up with other things. I guess I know what I'm doing tomorrow.

Go Up