theuser42
Published © GPL3+

Computer Prank

Simblee BLE + Arduino Micro = FUN :-)

IntermediateWork in progress5 hours4,839
Computer Prank

Things used in this project

Hardware components

Arduino Micro
Arduino Micro
×1
SparkFun Simblee BLE Breakout - RFD77101
SparkFun Simblee BLE Breakout - RFD77101
This is the RFD77201
×1
Adafruit TXB0104 Bi-Directional Level Shifter
×1
Wire Cable - By the Foot
OpenBuilds Wire Cable - By the Foot
×1
USB Male Type A Solder type
×1
USB Male Type B Solderble
×1

Software apps and online services

Arduino IDE
Arduino IDE
RFduino Simblee for Mobile App

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Wiring for the Wireless rubber ducky

Code

Main Code - Prank Device

Arduino
This is the main Code that does the work.
#include "Keyboard.h"
#include "Mouse.h"

void setup() {
  // put your setup code here, to run once:
   Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available() > 0) {
    int inByte = Serial.read();
     
      switch (inByte) {
      case '0':
         Keyboard.begin();
         Mouse.begin();
        Serial.println("OK,0");
         delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Keyboard.print("ping www.yahoo.com -t"); 
         delay(6);
         Keyboard.press(0xB0);
         delay(6);
         Keyboard.releaseAll();
         delay(10000);
         Keyboard.press(0x80);
         Keyboard.press(0x63);
         delay(6);
         Keyboard.releaseAll(); 
         Mouse.end();
         Keyboard.end();
         Serial.println("END");
        break;
        
      case '1':
         Keyboard.begin();
         Mouse.begin();
         Serial.println("OK,1");
          delay(2);
         Keyboard.press(0x80); // Ctrl
         Keyboard.press(0xB1); // Esc
         delay(6);
         Keyboard.releaseAll();
         Keyboard.print("notepad"); 
         Keyboard.press(0xB0); //Enter
         delay(200); 
         Keyboard.releaseAll();
         delay(1000); 
         Keyboard.println("Hello Just to let you know I have control of your computer!");
         delay(500); 
         Keyboard.press(0xB0); 
         delay(6); 
         Keyboard.releaseAll(); 
         Keyboard.println("I see you watching movies. ;-)");
         delay(2900);
         Keyboard.press(0x82); //ALT
         Keyboard.press(0x66); //f
         Keyboard.press(0x78); //x
         delay(6);
         Keyboard.releaseAll();
         Keyboard.press(0x82); //ALT
         Keyboard.press(0x6E); // n
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end();
         Serial.println("END");
        break;
       
      case '2':
        Keyboard.begin();
         Mouse.begin();
          Serial.println("OK,2");
          delay(2);
         Mouse.move(240,40);
         delay(6); 
         Mouse.move(125,440);
         delay(6);
          Mouse.move(125,440);
         delay(10);
          Mouse.move(10,1000);
         delay(5);
          Mouse.move(0,-500);
         delay(3);
          Mouse.move(80,540);
         delay(1000);
          Mouse.move(1000,0);
         delay(1);
         Mouse.move(0,0); 
         delay(1000);
         Mouse.end();
         Keyboard.end();
         Serial.println("END");
        break;
     
      case '3':
         Keyboard.begin();
         Mouse.begin();
          Serial.println("OK,3");
          delay(2);
         Keyboard.press(0x83); //Windows KEY
         Keyboard.press(0x64); //d
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end();
         Serial.println("END");
        break;
        /*
      case '4':
         Keyboard.begin();
         Mouse.begin();
          Serial.println(OK 1);
          delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end()
        break;
      case '5':
        Keyboard.begin();
         Mouse.begin();
          Serial.println(OK 1);
          delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end()
        break;
      case '6':
         Keyboard.begin();
         Mouse.begin();
          Serial.println(OK 1);
          delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end()
        break;
      case '7':
         Keyboard.begin();
         Mouse.begin();
          Serial.println(OK 1);
          delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end()
        break;
      case '8':
        Keyboard.begin();
         Mouse.begin();
          Serial.println(OK 1);
          delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end()
        break;
      case '9':
         Keyboard.begin();
         Mouse.begin();
          Serial.println(OK 1);
          delay(2);
         Keyboard.press(0x80);
         Keyboard.press(0xB1);
         delay(6);
         Keyboard.releaseAll();
         Mouse.end();
         Keyboard.end()
        break;
      case 'a':
         Keyboard.begin();
         Mouse.begin();
         
         Mouse.end();
         Keyboard.end()
        break;
      case 'b':
         Keyboard.begin();
         Mouse.begin();
         
         Mouse.end();
         Keyboard.end()
        break;
     case 'c':
         Keyboard.begin();
         Mouse.begin();
         
         Mouse.end();
         Keyboard.end()
        break;
     case 'd':
         Keyboard.begin();
         Mouse.begin();
         
         Mouse.end();
         Keyboard.end()
        break;
     case 'e':
         Keyboard.begin();
         Mouse.begin();
         
         Mouse.end();
         Keyboard.end()
        break;
     case 'f':
         Keyboard.begin();
         Mouse.begin();
         
         Mouse.end();
         Keyboard.end()
        break;
        */
    
   }
  }
}

BLE Prank Code

Arduino
This is the BLE code that make this fun prank from 32ft way.
/*
 * Prank Divice Oen
 * Date: 5/2/2018
 * Made by: theuser42
 * Decrption: 
 *     This the the first code for the prank device help it  
 *     be wireless using BLE
 */


#include <SimbleeForMobile.h>

uint8_t ui_button[16];

/*
 * Traditional Arduino setup routine
 * 
 * Initialize the SimbleeForMobile environment.
 */
void setup() {
  Serial.begin(9600);
  // put your setup code here, to run once:
  SimbleeForMobile.deviceName = "CPU Prank";
  SimbleeForMobile.advertisementData = "Data";
  SimbleeForMobile.domain = "prank.simblee.com";
  // Begin Simblee UI
  SimbleeForMobile.begin();
}





/*
 * The traditional Arduino loop method
 * 
 * Enable SimbleeForMobile functionality by calling the process method
 * each time through the loop. This method must be called regularly for
 * functionality to work.
 */
void loop() {
  // put your main code here, to run repeatedly:
  // process must be called in the loop for Simblee UI
  SimbleeForMobile.process();  
}





/*
 * SimbleeForMobile UI callback requesting the user interface
 */
void ui()
{  
  SimbleeForMobile.beginScreen();

 SimbleeForMobile.beginScreen(WHITE);
  SimbleeForMobile.drawText(90,230, "KEYPAD", BLUE, 50);
  ui_button[0] = SimbleeForMobile.drawButton(0,300,80,"Ping");
  ui_button[1] = SimbleeForMobile.drawButton(0,350,80,"Note");
  ui_button[2] = SimbleeForMobile.drawButton(0,400,80,"Mouse");
  ui_button[3] = SimbleeForMobile.drawButton(0,450,80,"Hide Windows");
 
  ui_button[4] = SimbleeForMobile.drawButton(83,300,80,"4");
  ui_button[5] = SimbleeForMobile.drawButton(83,350,80,"5");
  ui_button[6] = SimbleeForMobile.drawButton(83,400,80,"6");
  ui_button[7] = SimbleeForMobile.drawButton(83,450,80,"7");
  
  ui_button[8] = SimbleeForMobile.drawButton(166,300,80,"8");
  ui_button[9] = SimbleeForMobile.drawButton(166,350,80,"9");
  ui_button[10] = SimbleeForMobile.drawButton(166,400,80,"10");
  ui_button[11] = SimbleeForMobile.drawButton(166,450,80,"11");
   
  ui_button[12] = SimbleeForMobile.drawButton(250,300,80,"12");
  ui_button[13] = SimbleeForMobile.drawButton(250,350,80,"13");
  ui_button[14] = SimbleeForMobile.drawButton(250,400,80,"14");
  ui_button[15] = SimbleeForMobile.drawButton(250,450,80,"15");

  
    SimbleeForMobile.setEvents(ui_button[0], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[1], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[2], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[3], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[4], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[5], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[6], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[7], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[8], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[9], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[10], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[11], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[12], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[13], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[14], EVENT_PRESS);
     SimbleeForMobile.setEvents(ui_button[15], EVENT_PRESS);
  SimbleeForMobile.endScreen();
}





/*
 * SimbleeForMobile event callback method
 */
void ui_event(event_t &event)
{
  if (event.id == ui_button[0] ){
    if (event.type == EVENT_PRESS){
      Serial.println(0);
    }
  }
    if (event.id == ui_button[1] ){
    if (event.type == EVENT_PRESS){
      Serial.println(1);
    }
  }
    if (event.id == ui_button[2] ){
    if (event.type == EVENT_PRESS){
      Serial.println(2);
    }
  }
    if (event.id == ui_button[3] ){
    if (event.type == EVENT_PRESS){
      Serial.println(3);
    }
  }
    if (event.id == ui_button[4] ){
    if (event.type == EVENT_PRESS){
      Serial.println(4);
    }
  }
    if (event.id == ui_button[5] ){
    if (event.type == EVENT_PRESS){
      Serial.println(5);
    }
  }
    if (event.id == ui_button[6] ){
    if (event.type == EVENT_PRESS){
      Serial.println(6);
    }
  }
    if (event.id == ui_button[7] ){
    if (event.type == EVENT_PRESS){
      Serial.println(7);
    }
  }
    if (event.id == ui_button[8] ){
    if (event.type == EVENT_PRESS){
      Serial.println(8);
    }
  }
    if (event.id == ui_button[9] ){
    if (event.type == EVENT_PRESS){
      Serial.println(9);
    }
  }
    if (event.id == ui_button[10] ){
    if (event.type == EVENT_PRESS){
      Serial.println("a");
    }
  }
    if (event.id == ui_button[11] ){
    if (event.type == EVENT_PRESS){
      Serial.println("b");
    }
  }  if (event.id == ui_button[12] ){
    if (event.type == EVENT_PRESS){
      Serial.println("c");
    }
  }
    if (event.id == ui_button[13] ){
    if (event.type == EVENT_PRESS){
      Serial.println("d");
    }
  }
    if (event.id == ui_button[14] ){
    if (event.type == EVENT_PRESS){
      Serial.println("e");
    }
  }
    if (event.id == ui_button[15] ){
    if (event.type == EVENT_PRESS){
      Serial.println("f");
    }
  }
}

Credits

theuser42

theuser42

5 projects • 5 followers
I have been making for sometime now in the software world with Visual Basic 6.0/.NET. Hardware control is what i found a passion.

Comments