I got myself freeduino thanks to Kakeman, our resident hardware guru in hackerspacekl. It is not the latest, but it is good enough. After following the tutorial, I begin to feel to blink a LED, which built into the board
link.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ledPin = 13; | |
void setup(){ | |
pinMode(ledPin,OUTPUT); | |
} | |
void loop(){ | |
digitalWrite(ledPin,HIGH) ; | |
delay(10000); | |
} |
Then I play around with the serial library,
link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int incomingByte = 0; | |
int ledPin = 13; | |
void setup(){ | |
Serial.begin(9600); | |
pinMode(ledPin,OUTPUT); | |
} | |
void loop(){ | |
if(Serial.available() > 0){ | |
incomingByte = Serial.read(); | |
if(incomingByte == 116){ | |
Serial.println("Blinky"); | |
digitalWrite(ledPin,HIGH); | |
delay(1000); | |
digitalWrite(ledPin,LOW); | |
} | |
} | |
} |
In the end of the day it is fun, much before I continue, I need to find time to get a breadboard and more components, like LED,transistors, resistors etc, to make more stuff. Think i am going to play with this for a long time to come
No comments:
Post a Comment