-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
85 changed files
with
3,586 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+275 KB
...ojesi/3D Tasarım/littlefrenchkev's stl parts/MG90 panaromik parça/base_MG90.stl
Binary file not shown.
Binary file added
BIN
+607 KB
...si/3D Tasarım/littlefrenchkev's stl parts/MG90 tilt parçaları/Barrel_R_MG90.stl
Binary file not shown.
Binary file added
BIN
+355 KB
...sarım/littlefrenchkev's stl parts/MG90 tilt parçaları/Tilt_bracket_top_MG90.stl
Binary file not shown.
Binary file added
BIN
+164 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/bacak/long_leg_cap_round.stl
Binary file not shown.
Binary file added
BIN
+173 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/bacak/long_leg_round.stl
Binary file not shown.
Binary file added
BIN
+37.5 KB
...ojesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Arduino_bracket.stl
Binary file not shown.
Binary file added
BIN
+649 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Barrel_L.stl
Binary file not shown.
Binary file added
BIN
+35.9 KB
...esi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Bluetooth_bracket.stl
Binary file not shown.
Binary file added
BIN
+543 KB
...esi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Motor_bracket_3mm.stl
Binary file not shown.
Binary file added
BIN
+56 KB
...et Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Recoil_arm.stl
Binary file not shown.
Binary file added
BIN
+32.5 KB
... Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Recoil_arm_2.stl
Binary file not shown.
Binary file added
BIN
+399 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Roller.stl
Binary file not shown.
Binary file added
BIN
+338 KB
...i/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Tilt_bracket_bottom.stl
Binary file not shown.
Binary file added
BIN
+127 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/Top_cap.stl
Binary file not shown.
Binary file added
BIN
+51.2 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/band_lock.stl
Binary file not shown.
Binary file added
BIN
+138 KB
#Taret Projesi/3D Tasarım/littlefrenchkev's stl parts/genel parçalar/short_leg.stl
Binary file not shown.
Binary file added
BIN
+3.65 MB
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Android Versiyonu (LFK app)/LFK_Turret.apk
Binary file not shown.
181 changes: 181 additions & 0 deletions
181
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Arduino Kodları/Turret_arduino/Turret_arduino.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
#include <Servo.h> | ||
|
||
// Alper Burak PUSAR - 1030520446 | ||
|
||
//-----Servoları ve değişkenleri bildirme | ||
|
||
Servo pan_servo; | ||
Servo tilt_servo; | ||
Servo recoil_servo; | ||
|
||
const byte tilt_limit_1 = 65; | ||
const byte tilt_limit_2 = 180; | ||
const byte pan_limit_1 = 0; | ||
const byte pan_limit_2 = 180; | ||
const byte recoil_rest = 180; // Hareketsizken servo açısı | ||
const byte recoil_pushed = 125; // Mermiyi itmesi için servonun ulaşması gereken açı | ||
|
||
//-----Seri veri işleme ile ilgili değişkenler | ||
byte byte_from_app; | ||
const byte buffSize = 30; | ||
byte inputBuffer[buffSize]; | ||
const byte startMarker = 255; | ||
const byte endMarker = 254; | ||
byte bytesRecvd = 0; | ||
boolean data_received = false; | ||
|
||
//-----Motor zamanlaması ve ateşleme ile ilgili değişkenler | ||
bool is_firing = false; | ||
bool can_fire = false; | ||
bool recoiling = false; | ||
|
||
unsigned long firing_start_time = 0; | ||
unsigned long firing_current_time = 0; | ||
const long firing_time = 150; | ||
|
||
unsigned long recoil_start_time = 0; | ||
unsigned long recoil_current_time = 0; | ||
const long recoil_time = 2 * firing_time; | ||
|
||
const byte motor_pin = 12; | ||
boolean motors_ON = false; | ||
|
||
//8===========================D | ||
|
||
void setup() | ||
{ | ||
//-----motor pimi modunu tanımlama | ||
pinMode(motor_pin, OUTPUT); | ||
digitalWrite(motor_pin, LOW); | ||
|
||
//-----servoyu pinlere bağlama (Arduino Nano'da bu pinlerde pwn özelliği bulunmaktadır.) | ||
recoil_servo.attach(9); | ||
pan_servo.attach(10); | ||
tilt_servo.attach(11); | ||
|
||
//-----başlangıç sırası | ||
recoil_servo.write(recoil_rest); | ||
pan_servo.write(90); | ||
//tilt_servo.write(tilt_limit_2); | ||
delay(1000); | ||
//tilt_servo.write(tilt_limit_2 + abs((tilt_limit_2 - tilt_limit_1)/2)); | ||
tilt_servo.write(105); | ||
|
||
|
||
Serial.begin(9600); // seri haberleşmeyi başlatma | ||
} | ||
|
||
//8===========================D | ||
|
||
void loop() | ||
{ | ||
getDataFromPC(); | ||
set_motor(); | ||
if (data_received) { | ||
move_servo(); | ||
set_recoil(); | ||
set_motor(); | ||
} | ||
fire(); | ||
} | ||
|
||
//8===========================D | ||
|
||
void getDataFromPC() { | ||
|
||
//verilerin beklenen yapısı [başlangıç baytı, yatay miktarı, dikey miktarı, motor açık, ateşleme düğmesine basıldı, son bayt] | ||
//başlangıç baytı = 255 | ||
//yatay miktarı = 0 ve 253 bayt aralığında | ||
//dikey miktarı = 0 ve 253 bayt aralığında | ||
//motor açık = 0 kapalı - 1 açık | ||
//ateşleme düğmesine basıldı = herhangi basım olmaması durumunda 0 - tersi için 1 | ||
//end byte = 254 | ||
|
||
if (Serial.available()) { // Seri halinde veri mevcutsa | ||
|
||
byte_from_app = Serial.read(); //bir sonraki karakteri oku | ||
|
||
if (byte_from_app == 255) { // bulunursa başlangıç baytını ara | ||
bytesRecvd = 0; //alınan baytı 0'a sıfırla | ||
data_received = false; | ||
} | ||
|
||
else if (byte_from_app == 254) { // eğer bulunursa, bitiş baytını arayın | ||
data_received = true; // verilerin kullanılabilmesi için data_received öğesini true olarak ayarlama | ||
} | ||
|
||
else { // arabelleğe alınan baytı ekle | ||
inputBuffer[bytesRecvd] = byte_from_app; //giriş arabelleğine karakter ekle | ||
bytesRecvd++; // alınan artımlı bayt (bu işlem bir indeks olarak hareket eder) | ||
if (bytesRecvd == buffSize) { // inputBuffer'ın doldurulması durumunda alınan bir güvenlik (bu olmamalıdır) | ||
bytesRecvd = buffSize - 1; // eğer bytesReceived > buffer size'dan büyükse, bytesReceived'ı buffer size'dan daha küçük ayarla | ||
} | ||
} | ||
} | ||
} | ||
|
||
//8===========================D | ||
|
||
void move_servo() { | ||
|
||
byte pan_servo_position = map(inputBuffer[0], 0, 253, pan_limit_2, pan_limit_1);//inputbuffer değerini yatay servo pozisyon değerine dönüştür | ||
pan_servo.write(pan_servo_position); //yatay servo konumunu ayarla | ||
byte tilt_servo_position = map(inputBuffer[1], 0 , 253, tilt_limit_2, tilt_limit_1); //inputbuffer değerini dikey servo pozisyon değerine dönüştür | ||
tilt_servo.write(tilt_servo_position); //dikey servo konumunu ayarla | ||
} | ||
|
||
//8===========================D | ||
|
||
void set_recoil() { | ||
|
||
if (inputBuffer[3] == 1) { //eğer ateşlemeye basılırsa | ||
if (!is_firing && !recoiling) { //ve zaten ateş etmiyor veya geri tepmiyorsa | ||
can_fire = true; | ||
} | ||
} | ||
else { // eğer ateşlemeye basılmazsa | ||
can_fire = false; | ||
} | ||
} | ||
|
||
//8===========================D | ||
|
||
void set_motor() { | ||
//-----ırfp250n mosfet kullanarak motorları çalıştırma ve durdurma | ||
|
||
if (inputBuffer[2] == 1) { //ekrana dokunulursa | ||
digitalWrite(motor_pin, HIGH); //motoru aç | ||
motors_ON = true; | ||
} | ||
else { //ekrana dokunulmazsa | ||
digitalWrite(motor_pin, LOW); //motoru kapat | ||
motors_ON = false; | ||
|
||
} | ||
} | ||
|
||
//8===========================D | ||
|
||
void fire() { //motor baytı açıksa, motoru aç ve açık kaldığını kontrol et | ||
|
||
if (can_fire && !is_firing && motors_ON) { | ||
//if (can_fire && !is_firing) { | ||
firing_start_time = millis(); | ||
recoil_start_time = millis(); | ||
is_firing = true; | ||
} | ||
|
||
firing_current_time = millis(); | ||
recoil_current_time = millis(); | ||
|
||
if (is_firing && firing_current_time - firing_start_time < firing_time) { | ||
recoil_servo.write(recoil_pushed); | ||
} | ||
else if (is_firing && recoil_current_time - recoil_start_time < recoil_time) { | ||
recoil_servo.write(recoil_rest); | ||
} | ||
else if (is_firing && recoil_current_time - recoil_start_time > recoil_time) { | ||
is_firing = false; | ||
} | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+362 KB
#Taret Projesi/Kodlar ve Bağlantı Şemaları/HC-05 Hariç Tüm Bağlantılar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.54 KB
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Taret_exe/GUI/COM_pot_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
94 changes: 94 additions & 0 deletions
94
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Taret_exe/GUI/Dial.ui
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>COM_port</class> | ||
<widget class="QWidget" name="COM_port"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>528</width> | ||
<height>233</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Form</string> | ||
</property> | ||
<property name="styleSheet"> | ||
<string notr="true">background-color: rgb(51, 51, 51);</string> | ||
</property> | ||
<widget class="QLabel" name="label"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>10</x> | ||
<y>10</y> | ||
<width>191</width> | ||
<height>81</height> | ||
</rect> | ||
</property> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="pixmap"> | ||
<pixmap>COM_pot_text.png</pixmap> | ||
</property> | ||
</widget> | ||
<widget class="QLineEdit" name="COMportlineEdit"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>220</x> | ||
<y>20</y> | ||
<width>281</width> | ||
<height>61</height> | ||
</rect> | ||
</property> | ||
<property name="font"> | ||
<font> | ||
<pointsize>20</pointsize> | ||
</font> | ||
</property> | ||
<property name="text"> | ||
<string>COM 3</string> | ||
</property> | ||
<property name="maxLength"> | ||
<number>30</number> | ||
</property> | ||
<property name="frame"> | ||
<bool>true</bool> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
<widget class="QPushButton" name="connect_button"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>130</x> | ||
<y>100</y> | ||
<width>271</width> | ||
<height>131</height> | ||
</rect> | ||
</property> | ||
<property name="styleSheet"> | ||
<string notr="true"> QPushButton:flat { border: none; }</string> | ||
</property> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
<property name="icon"> | ||
<iconset> | ||
<normaloff>connect_button.png</normaloff>connect_button.png</iconset> | ||
</property> | ||
<property name="iconSize"> | ||
<size> | ||
<width>1000</width> | ||
<height>100</height> | ||
</size> | ||
</property> | ||
<property name="flat"> | ||
<bool>true</bool> | ||
</property> | ||
</widget> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
Binary file added
BIN
+45.7 KB
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Taret_exe/GUI/bluetooth_connect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.6 KB
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Taret_exe/GUI/connect_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.1 KB
#Taret Projesi/Kodlar ve Bağlantı Şemaları/Taret_exe/GUI/motor_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.