Arduino hakkında yardımcı olabilecek bi hayır sever varmı ?
Teknoseyir gündemi
#Doom#ModemTavsiyesi#YeniProfilResmi#WSL#19MayısAtatürküAnmaGençlikveSporBayram#Sahaflar#Grok#andor#Bisiklet#Mattel#gogSon bir saat içinde 142 ziyaretçi, 138 kayıtlı kullanıcı giriş yaptı.
- © 2025 TeknoSeyir
- Hakkımızda
- İletişim
- Kullanım Koşulları
- Gizlilik Politikası
- Sosyal Ağ Kuralları
- RAM desteği bilendenal.com tarafından sağlanmaktadır.
- Sunucu desteği DGN Teknoloji tarafından
sağlanmaktadır.
https://www.youtube.com/watch?v=7nm1sERTW4g üstad bu videodaki açı ölçerden yapmam lazım kod bilgim cok az minnacık hatta yok diyebiliriz yeniyim arduinoda. gerekli malzemeleri temin ettim kaynak kodu buldum kütüphaneleri indirdim fakat acı ölçer düzgün çalısmıyor yalnıs ölçüyor bu birinci sorunum 2. sorunum ise acı ölçer düzgün ölçüm yaparsa eğer ondalık değilde yüzdelik ölçüm yapsın istiyorum yanı 21,5 değilde 21,55 gibi ölçümler yapmam lazım
kullandıgım kod bu kütüphaneleri tek tek yükledim
#define _SOFTI2C_H
#include
#include
#include
#include
#include "SoftwareI2C.h"
#include "I2C.h"
#include "MPU6050.h"
#define SOFTWARE_I2C
void calibrate();
MPU6050 MPU;
const float radToDeg = 180.0 / 3.1415926535897932384626433832795;
int xOffset=0, yOffset=0;
float zScaleOffset = 1; // multiply Z axis with this value to get as close to 1g as possible.
void setup() {
// put your setup code here, to run once:
Timer1.initialize();
#if defined (SOFTWARE_I2C)
// Use software I2C
// Uno and Leonardo, use pin 5 for SCL and 6 for SDA. Mega2560, use pin 5 for SCL and pin A5 for SDA.
SoftI2C1.initialize();
MPU.initialize(&SoftI2C1, MPU_DEFAULT_ADDRESS << 1, ACCEL_FS_2, GYRO_FS_250, DLPF_BW_5);
#else
// Use hardware I2C
Wire.begin();
I2C1.initialize(&Wire);
MPU.initialize(&I2C1, MPU_DEFAULT_ADDRESS, ACCEL_FS_2, GYRO_FS_250, DLPF_BW_5);
#endif
MFS.initialize(&Timer1);
}
void loop() {
// put your main code here, to run repeatedly:
byte btn = MFS.getButton();
if (btn == BUTTON_1_LONG_PRESSED)
{
calibrate();
}
MPU.getAccelRaw();
MPU.accel_X_Raw -= xOffset;
MPU.accel_Y_Raw -= yOffset;
float angle;
if (MPU.accel_Z_Raw == 0)
{
angle = 90;
}
else
{
angle = atan((float)MPU.accel_Y_Raw / (MPU.accel_Z_Raw * zScaleOffset)) * radToDeg; // calculate for y axis
//angle = atan((float)MPU.accel_X_Raw / (MPU.accel_Z_Raw * zScaleOffset)) * radToDeg; // calculate for X axis
}
MFS.write(angle, 1);
delay(200);
}
void calibrate()
{
MFS.write(" ");
MFS.writeLeds(LED_1, ON);
MFS.blinkLeds(LED_1, ON);
// discard first few sensor readings.
for (int i=0; i<10; i++)
{
MPU.getAccelRaw();
delay(10);
}
int xValues[5], yValues[5], zValues[5];
for (int i=0; i<5; i++)
{
MPU.getAccelRaw();
xValues[i] = MPU.accel_X_Raw;
yValues[i] = MPU.accel_Y_Raw;
zValues[i] = MPU.accel_Z_Raw;
delay(300);
}
xOffset = MedianOf5(xValues[0], xValues[1], xValues[2], xValues[3], xValues[4]);
yOffset = MedianOf5(yValues[0], yValues[1], yValues[2], yValues[3], yValues[4]);
zScaleOffset = (float)MPU.accelScaleValue / MedianOf5(zValues[0], zValues[1], zValues[2], zValues[3], zValues[4]);
MFS.blinkLeds(LED_1, OFF);
// clear the input button buffer by reading it and discarding value.
for (int i=0; i<10; i++)
{
MFS.getButton();
}
}
kütüphanenin içinde example yok mu hiç?
@frt kütüphane içindeki örnek kod zaten bu
gerçi su an mpu6050 sensörüm yok sinirden parçaladım 😀 sparişini verdim yenisi yarın gelecek ne olur ne olmaz de 2 tane sipariş verdim 😀
@frt #Arduino
bu hataları alıyorum neden?
Arduino:1.6.12 (Windows 10), Kart:"Arduino/Genuino Uno"
Derleme seçenekleri değiştirildi, tümü yeniden derleniyor.
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_wait_scl_high' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_wait_scl_high' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_wait_scl_high' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_wait_scl_high' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_wait_scl_high' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_wait_scl_high' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
`ass_i2c_delay_half' referenced in section `.text' of C:\Users\MONSTER\AppData\Local\Temp\cc9CGn5n.ltrans0.ltrans.o: defined in discarded section `.text' of sketch\SoftwareI2C.cpp.o (symbol from plugin)
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
bu hataları alıyorum neden?
@onrdrsy üstadım anlamadım ? nasıl yazıyım ?
@erenahmtt Code ile
@onrdrsy kodlarım bunalr
#define _SOFTI2C_H
#include
#include
#include
#include
#include "SoftwareI2C.h"
#include "I2C.h"
#include "MPU6050.h"
#define SOFTWARE_I2C
void calibrate();
MPU6050 MPU;
const float radToDeg = 180.0 / 3.1415926535897932384626433832795;
int xOffset=0, yOffset=0;
float zScaleOffset = 1; // multiply Z axis with this value to get as close to 1g as possible.
void setup() {
// put your setup code here, to run once:
Timer1.initialize();
#if defined (SOFTWARE_I2C)
// Use software I2C
// Uno and Leonardo, use pin 5 for SCL and 6 for SDA. Mega2560, use pin 5 for SCL and pin A5 for SDA.
SoftI2C1.initialize();
MPU.initialize(&SoftI2C1, MPU_DEFAULT_ADDRESS << 1, ACCEL_FS_2, GYRO_FS_250, DLPF_BW_5);
#else
// Use hardware I2C
Wire.begin();
I2C1.initialize(&Wire);
MPU.initialize(&I2C1, MPU_DEFAULT_ADDRESS, ACCEL_FS_2, GYRO_FS_250, DLPF_BW_5);
#endif
MFS.initialize(&Timer1);
}
void loop() {
// put your main code here, to run repeatedly:
byte btn = MFS.getButton();
if (btn == BUTTON_1_LONG_PRESSED)
{
calibrate();
}
MPU.getAccelRaw();
MPU.accel_X_Raw -= xOffset;
MPU.accel_Y_Raw -= yOffset;
float angle;
if (MPU.accel_Z_Raw == 0)
{
angle = 90;
}
else
{
angle = atan((float)MPU.accel_Y_Raw / (MPU.accel_Z_Raw * zScaleOffset)) * radToDeg; // calculate for y axis
//angle = atan((float)MPU.accel_X_Raw / (MPU.accel_Z_Raw * zScaleOffset)) * radToDeg; // calculate for X axis
}
MFS.write(angle, 1);
delay(200);
}
void calibrate()
{
MFS.write(" ");
MFS.writeLeds(LED_1, ON);
MFS.blinkLeds(LED_1, ON);
// discard first few sensor readings.
for (int i=0; i<10; i++)
{
MPU.getAccelRaw();
delay(10);
}
int xValues[5], yValues[5], zValues[5];
for (int i=0; i<5; i++)
{
MPU.getAccelRaw();
xValues[i] = MPU.accel_X_Raw;
yValues[i] = MPU.accel_Y_Raw;
zValues[i] = MPU.accel_Z_Raw;
delay(300);
}
xOffset = MedianOf5(xValues[0], xValues[1], xValues[2], xValues[3], xValues[4]);
yOffset = MedianOf5(yValues[0], yValues[1], yValues[2], yValues[3], yValues[4]);
zScaleOffset = (float)MPU.accelScaleValue / MedianOf5(zValues[0], zValues[1], zValues[2], zValues[3], zValues[4]);
MFS.blinkLeds(LED_1, OFF);
// clear the input button buffer by reading it and discarding value.
for (int i=0; i<10; i++)
{
MFS.getButton();
}
}
@erenahmtt
bu şekilde demek istedim.
@onrdrsy https://paste.ubuntu.com/23558052/ kodlar burda dostum kdları çalıstırıdım fakat açı ölçer düzgün açıyı ölçmuyor
yardım edecek kimse yokmu ?
kodları buraya https://paste.ubuntu.com/ yapıştırıp paylaşabilir misin bir de. sitede kodlar bozuluyor.
@frt https://paste.ubuntu.com/23558048/ bunlar hata kodları
@frt https://paste.ubuntu.com/23558052/ buda yüklemeye çalıstıgım kodlar
@erenahmtt maalesef bir çözüm bulamadım 🙁
@frt eyvallah hocam saolasın yinede ilgilendiğin için
@frt umarım kodlar doğu gelmiştir
@frt kardeşim arduino konusunda yeniyim. Titreşim Sensörü ile bi alanda titreşim ölçmek istiyorum sensörlerini falan aldım bu konuda yardımcı olurmusun bana ?
sensörün modeli nedir?
@frt elimde 3 tane sensör var birinicisi LDT0-028K ikincisi LM393 ücüncüsü SW-18020P bunlardan en hassı hangisi bilmiyorum ama en hasas olanını kullanmak istiyorum
@erenahmtt hangisi daha hassas bilmiyorum. bence hepsinin amacı farklı gibi. mesela şu tam toprağa gömmelik gibi duruyor 🙂
http://www.instructables.com/id/Earthquake-Vibration-Sensor/
@frt kesinlikle hepsinin amacı farklı bi tanesininden veri alabilsem diğerlerinide kullancam ben bu titreşim sensörü ile metal dişlilerin titreşimini ölçmek istiyorum çalışırken
@erenahmtt yukarıda verdiğim linke bir bak istersen. orda örnek olarak yapmış adam