Surprise! We've been running on hardware provided by BuyVM for a few months and wanted to show them a little appreciation.
Running a paste site comes with unique challenges, ones that aren't always obvious and hard to control. As such, BuyVM offered us a home where we could worry less about the hosting side of things and focus on maintaining a clean and useful service! Go check them out and show them some love!
Submitted on May 26, 2016 at 11:44 AM

Section 1 (Text)

#include <SoftwareSerial.h>
 
SoftwareSerial bluetooth(10, 11); // RX, TX
int a1 = 6;
int a2 = 5;

String receivedBluetoothString = "";
 
void setup() {
  bluetooth.begin(9600);
  pinMode(a1, OUTPUT);
  pinMode(a2, OUTPUT);
}
 
void loop() {
  while (bluetooth.available() > 0) {
 
    char receivedBluetoothChar = bluetooth.read();
    receivedBluetoothString += receivedBluetoothChar;
 
    if (receivedBluetoothChar == '\n') {
 
      if (receivedBluetoothString.toInt() == 887425) {
        digitalWrite(a1, HIGH);
        delay(500);
        digitalWrite(a1, LOW);
      } else if (receivedBluetoothString.toInt() == 887426) {
        digitalWrite(a1, HIGH);
        delay(1000);
        digitalWrite(a1, LOW);
      }
 
      receivedBluetoothString = "";
    }
  }
}