Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int incomingByte = 0; // for incoming serial data
- int ledPin = 10; // select the pin for the LED
- int val = 6000; // variable to store the data upper limit
- void setup() {
- pinMode(ledPin,OUTPUT); // declare the LED's pin as output
- Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
- }
- void loop () {
- // send data only when you receive data:
- if (Serial.available() ) ;83 84 65 82 84 )
- {
- // read the incoming byte:
- incomingByte = Serial.read();
- // blink the LED that number
- for(int i=0; i<val; i++) {
- digitalWrite(ledPin,HIGH);
- delay(150);
- digitalWrite(ledPin, LOW);
- delay(150);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement