ci: add tpmb

pull/942/head
Tomas Susanka 4 years ago
parent 1be5e577ee
commit 24fff39314

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Marek Mahut
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,4 @@
default: compile
compile:
arduino --upload tpmb.ino --port /dev/ttyACM1

@ -0,0 +1,21 @@
# Trezor (one), press my buttons.
A simple hardware testing drone for Trezor One.
![](demo.gif)
## Hardware
To build this simple bot, we are using:
* Arduino UNO R3 (or compatible)
* 2x Tower Pro Micro Servo 9g SG9
## Software
* ```arduino/``` includes the code for the hardware
* ```scripts/``` includes the control scripts
## 3D Models
* ```model/``` includes the STL as well as OpenSCAD files

@ -0,0 +1,5 @@
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "tpmb-arduino";
buildInputs = [ arduino ];
}

@ -0,0 +1,77 @@
#include <Servo.h>
#define right_unpressed 79
#define right_pressed 0
#define left_unpressed 0
#define left_pressed 79
String command;
Servo servo_right;
Servo servo_left;
void setup() {
// Starting the serial console
Serial.begin(9600);
// Attaching both servos
servo_right.attach(7);
servo_left.attach(8);
// Setting them un unpressed position
servo_right.write(right_unpressed);
servo_left.write(left_unpressed);
Serial.println("Ready for commands, press my buttons!");
}
void loop() {
if(Serial.available()){
command = Serial.readStringUntil('\n');
if(command.equals("right press")){
Serial.println("Pressing right button.");
servo_right.write(right_pressed);
}
else if(command.equals("right unpress")){
Serial.println("Unpressing right button.");
servo_right.write(right_unpressed);
}
else if(command.equals("left press")){
Serial.println("Pressing the left button.");
servo_left.write(left_pressed);
}
else if(command.equals("left unpress")){
Serial.println("Unpressing the left button.");
servo_left.write(left_unpressed);
}
else if(command.equals("left click")){
Serial.println("Clicking the left button.");
servo_left.write(left_pressed);
delay(500);
servo_left.write(left_unpressed);
}
else if(command.equals("right click")){
Serial.println("Clicking the right button.");
servo_right.write(right_pressed);
delay(500);
servo_right.write(right_unpressed);
}
else if(command.equals("all press")){
Serial.println("Pressing all buttons.");
servo_right.write(right_pressed);
servo_left.write(left_pressed);
}
else if(command.equals("all unpress")){
Serial.println("Unpressing all buttons.");
servo_right.write(right_unpressed);
servo_left.write(left_unpressed);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 MiB

@ -0,0 +1,8 @@
# 3D print model for tpmb
This is pretty easy to print. First open ```base.scad``` with OpenSCAD and
export your ```.stl``` file with it.
Open it with your slider, we are using
Original Priska i3 MK3 to print our models. 0.15mm quality setting with standard
PLA works fine for us.

@ -0,0 +1,61 @@
// Version: 0.8
// Horizontal wall
difference() {
// Creating the base
cube([100,80,7]);
// Cutting a hole for trezor to sit in
translate([0,25,2])
cube([65,30,10]);
}
// Vertical wall
difference() {
// Creating the vertical block
cube([10, 80, 98]);
// Cutting an opening for stuck trezor
translate([0,26,-2])
cube([10,28,12]);
// Creating opening for right servo
translate([0,7-3,12])
cube([10,23,92]);
translate([0,0,40])
cube([10,23,92]);
// Creating opening for left servo
translate([0,50+3,12])
cube([10,23,92]);
translate([0,50+8,40])
cube([10,23,92]);
// Holes
translate([5,2,20])
rotate([0,90,0])
cylinder(40,1);
// Holes
translate([5,2+27,20])
rotate([0,90,0])
cylinder(40,1);
// Holes
translate([5,80-29,20])
rotate([0,90,0])
cylinder(40,1);
// Holes
translate([5,80-2,20])
rotate([0,90,0])
cylinder(40,1);
}
// Creating stopper
translate([0,25,0])
cube([5, 6,10]);
// Creating the blocker block
translate([0,85,0])
cube([28, 6,10]);

File diff suppressed because it is too large Load Diff

@ -0,0 +1,5 @@
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "tpmb-model";
buildInputs = [ openscad prusa-slicer ];
}
Loading…
Cancel
Save