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

Welcome To GaiaOnline. This forum is for people who play gaia and people who are new we can teach you in this forum how to play in gaia if theres a question just go to the chatbox and you will see people there not only admin but a lot and they can help as
 
HomeHome  PortalPortal  Latest imagesLatest images  SearchSearch  RegisterRegister  Log in  

 

 Lighting an arduino led from laptop keyboard keystroke

Go down 
AuthorMessage
whang2011




Posts : 177
Join date : 2011-03-17

Lighting an arduino led from laptop keyboard keystroke  Empty
PostSubject: Lighting an arduino led from laptop keyboard keystroke    Lighting an arduino led from laptop keyboard keystroke  Icon_minitimeFri Jul 20, 2012 12:58 am

I'm working on a project to light an led on an uno arduino when I hit number one key on my Dell Studio Keyboard . Here is the code that I have so far. I just don't understand why it won't light the led on pin 13...any help would be greatly appreciated!

int inByte = 0; // initialize the variable inByte
const int ledPin = 13; // pin that the LED is attached to

void setup(){

pinMode(ledPin, OUTPUT); // initialize the LED pin as an output
Serial.begin(57600); // set serial monitor to same speed
}
void loop(){
if (Serial.available()>0) { // check if any data received
inByte = Serial.read(); // yes, so read it from incoming buffer
if (inByte == 1){
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin,LOW);
}
}
}

For more laptop reviews, please visit : http://www.laptopsview.info
Back to top Go down
http://www.buycheapkeyboard.com/
 
Lighting an arduino led from laptop keyboard keystroke
Back to top 
Page 1 of 1
 Similar topics
-
» Both laptop keyboard and virtual keyboard will not type certain letters
» Laptop keyboard???
» Problem with laptop keyboard
» Damaged laptop keyboard
» DIY Laptop Keyboard Cover

Permissions in this forum:You cannot reply to topics in this forum
GaiaOnline :: Your first category :: Your first forum-
Jump to: