obniz developer team
Published

Unlock iPhone from obniz

As Bluetooth-keyboard, obniz unlocks iPhone.

BeginnerFull instructions provided580
Unlock iPhone from obniz

Things used in this project

Hardware components

obniz
Cambrian Robotics obniz
×1

Story

Read more

Code

Untitled file

HTML
<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="//code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://unpkg.com/obniz@1.9.1/obniz.js"></script>
</script>
</head>
<body>
<div id="obniz-debug"></div>
<button id="config">config rn42</button>
<script>
var obniz = new Obniz("OBNIZ ID HERE");
obniz.onconnect = async function () {
 obniz.io11.output(true); // regulator required 5v to 3.3v
 obniz.io8.output(false);
 var rn42 = obniz.wired("RN42", 9, 10);
 var unlockBtn = obniz.wired("Button", 0, 2);
 var msgBtn = obniz.wired("Button", 4, 6);
 msgBtn.onChange(function(pressed){
   if (pressed) {
     rn42.send("hello\nThis is writtern from obniz");
   }
 });
 unlockBtn.onChange(function(pressed){
   if (pressed) {
     var passcode = [1,2,3,4,5,6];
     rn42.send("\n");
     obniz.freeze(500);
     rn42.send("\n");
     obniz.freeze(500);
     for (var i=0; i<passcode.length; i++) {
       rn42.send(""+passcode[i]);
       obniz.freeze(400);
     } 
   }
 });
 $("#config").click(function(){
   rn42.config({
     display_name: "obniz",
     master_slave: "slave",
     profile: "HID",
     auth: "just-work",
     power: 16,
   })
 })
}
</script>
</body>
</html> 

Credits

obniz developer team
80 projects • 37 followers
Development board "obniz" is controlled via the internet.

Comments