Çözüldü : Harici adaptör bağladım sorun kalmadı, sanırım usb'den aldığı güç yetersiz geldi.

Ardunio ve Max7219 dot matrix ile bir problem yaşıyorum ve çözemedim.
Aşağıdaki kod ile seri porttan gelen stringi kaydırarak ekrana yazdırmam gerekiyor;

Fakat bu şekilde seri porttan bir veri gönderdiğimde outputta doğru şekilde görüyorum, led ekranında gözükür gibi olup kayboluyor. Video olarak ekledim. Sorun neden kaynaklanıyor olabilir bir türlü çözemedim.

https://www.youtube.com/shorts/AtKTWGA4CPc

#include
#include
#include

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 1
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10

MD_Parola display = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

String incomingData = "";

void setup() {
Serial.begin(9600);
display.begin();
display.setIntensity(0);
display.displayClear();
}

void loop() {
if (Serial.available() > 0) {
incomingData = Serial.readStringUntil('\n');
Serial.println("Mesaj alındı: " + incomingData);
display.displayClear();

display.displayText(incomingData.c_str(), PA_CENTER, 100, 100, PA_SCROLL_LEFT, PA_SCROLL_LEFT);
while (!display.displayAnimate()) {
delay(100);
}
}
}

BeğenFavori PaylaşYorum yap

Kütüphanede tanımlanan CS pininin 10 olarak değiştirilmemesi Arduino'nun ethernet modülü ile bağlantı kuramamasına neden olacaktır. "EtherCard.h" dosyasındaki "csPin" değişkenini 10 olarak ayarlamayı unutmayınız. Bu değişikliği nasıl yapabilirim yardımcı olurmusunuz #Arduino

BeğenFavori PaylaşYorum yap
  • Türker Sezer @dirigeant

    EtherCard.h dosyasini bir metin editoriyle acin, csPin degerinin tanimlandigi satiri bulup karsisindaki degeri 10 olarak degistirin. Kutuphaneyi belgelerindeki komutlari kullanarak tekrar derleyin.

    • Selami61 @selami61

      onuda değiştirdim olmadı müsaitseniz teamviewer den yardımcı olurmusunuz

    • Selami61 @selami61

      // Twitter client sketch for ENC28J60 based Ethernet Shield. Uses
      // arduino-tweet.appspot.com as a OAuth gateway.
      // Step by step instructions:
      //
      // 1. Get a oauth token:
      // http://arduino-tweet.appspot.com/oauth/twitter/login
      // 2. Put the token value in the TOKEN define below
      // 3. Run the sketch!
      //
      // WARNING: Don't send more than 1 tweet per minute!
      // WARNING: This example uses insecure HTTP and not HTTPS.
      // The API key will be sent over the wire in plain text.
      // NOTE: Twitter rejects tweets with identical content as dupes (returns 403)
      //
      // License: GPLv2

      #include

      // OAUTH key from http://arduino-tweet.appspot.com/
      #define TOKEN "Insert-your-token-here"

      // ethernet interface mac address, must be unique on the LAN
      byte mymac[] = { 0x00,0xFF,0xDC,0x7A,0x55,0x9C };

      const char website[] PROGMEM = "2346581264-H0qQ7jHFpZodFmudJzzPUPEftd2oHWmi9OqnZcp";

      static byte session;

      byte Ethernet::buffer[700];
      Stash stash;

      static void sendToTwitter () {
      Serial.println("Sending tweet...");
      byte sd = stash.create();

      const char tweet[] = "trdgvjbhjkj";
      stash.print("token=");
      stash.print(TOKEN);
      stash.print("&status=");
      stash.println(tweet);
      stash.save();
      int stash_size = stash.size();

      // Compose the http POST request, taking the headers below and appending
      // previously created stash in the sd holder.
      Stash::prepare(PSTR("POST http://$F/update HTTP/1.0" "\r\n"
      "Host: $F" "\r\n"
      "Content-Length: $D" "\r\n"
      "\r\n"
      "$H"),
      website, website, stash_size, sd);

      // send the packet - this also releases all stash buffers once done
      // Save the session ID so we can watch for it in the main loop.
      session = ether.tcpSend();
      }

      void setup () {
      Serial.begin(57600);
      Serial.println("\n[Twitter Client]");

      // Change 'SS' to your Slave Select pin, if you arn't using the default pin
      if (ether.begin(sizeof Ethernet::buffer, mymac, SS) == 0)
      Serial.println(F("Failed to access Ethernet controller"));
      if (!ether.dhcpSetup())
      Serial.println(F("DHCP failed"));

      ether.printIp("IP: ", ether.myip);
      ether.printIp("GW: ", ether.gwip);
      ether.printIp("DNS: ", ether.dnsip);

      if (!ether.dnsLookup(website))
      Serial.println(F("DNS failed"));

      ether.printIp("SRV: ", ether.hisip);

      sendToTwitter();
      }

      void loop () {
      ether.packetLoop(ether.packetReceive());

      const char* reply = ether.tcpReply(session);
      if (reply != 0) {
      Serial.println("Got a response!");
      Serial.println(reply);
      }
      }

Arduino ile bilgisi olanlar yardımcı olabilir mi?
Biz şimdi aşağıdaki linklerde olan kodları birleştirmeyi başardık fakat amacımız bluetooth kontrollü aracı hcsr-04 yardımı ile engellerden kaçması. Kodları birleştirdik ancak biz bluetootha bağlanana kadar motorlar boşta dönüyor.. Biz bluetootha bağlanana kadar motorların dönmemesini nasıl sağlarız bir türlü çözemedim.

kullandığımı kodlar:
bluetooth kontrol kodu;
http://lezzetlirobottarifleri.com/video/cep-telefonu-kontrollu-arac

hcsr-04;
http://lezzetlirobottarifleri.com/video/arduino-ile-engelden-kacan-robot-v1-00

bizim yazdığımız kod ise burada;

#include

SoftwareSerial bt_iletisim(6, 7);
#define echoPin 2 //Ultrasonik sensörün echo pini Arduino'nun 12.pinine
#define trigPin 3 //Ultrasonik sensörün trig pini Arduino'nun 13.pinine tanımlandı.

#define sol_ileri 8
#define sol_geri 9
#define sol_hiz 10

#define sag_ileri 13
#define sag_geri 12
#define sag_hiz 11

long sure, uzaklik; //süre ve uzaklık diye iki değişken tanımlıyoruz.
int motorlar_hiz = 255;
byte son_islem;

void setup()
{
// ultrasonik sensör Trig pininden ses dalgaları gönderdiği için OUTPUT (Çıkış),
// bu dalgaları Echo pini ile geri aldığı için INPUT (Giriş) olarak tanımlanır.
pinMode(echoPin, INPUT);
pinMode(trigPin, OUTPUT);

pinMode(sol_ileri, OUTPUT);
pinMode(sag_ileri, OUTPUT);
pinMode(sol_geri, OUTPUT);
pinMode(sag_geri, OUTPUT);
pinMode(sol_hiz, OUTPUT);
pinMode(sag_hiz, OUTPUT);

Serial.begin(9600);
bt_iletisim.begin(9600);
}

void loop(){

{
if (bt_iletisim.available())
{
char data = bt_iletisim.read();
Serial.println(data);

if (data == '1')
{
dur();
delay(10);
ileri();
son_islem = 1;
}
else if (data == '2')
{
dur();
delay(10);
geri();
son_islem = 2;
}
else if (data == '3')
{
dur();
delay(10);
sol();
son_islem = 3;
}
else if (data == '4')
{
dur();
delay(10);
sag();
son_islem = 4;
}
else if (data == '6')
{
dur();
}
else if (data == '0')
{
motorlar_hiz = motorlar_hiz + 25;
if (motorlar_hiz > 255)
{
motorlar_hiz = 255;
}
Serial.print("motorlar hiz= ");
Serial.println(motorlar_hiz);
son_isleme_devam_et();
}
else if (data == '5')
{
motorlar_hiz = motorlar_hiz - 25;
if (motorlar_hiz < 0)
{
motorlar_hiz = 0;
}
Serial.print("motorlar hiz= ");
Serial.println(motorlar_hiz);
son_isleme_devam_et();
}
}
}

digitalWrite(trigPin, LOW); //sensör pasif hale getirildi
delayMicroseconds(5);
digitalWrite(trigPin, HIGH); //Sensore ses dalgasının üretmesi için emir verildi
delayMicroseconds(10);
digitalWrite(trigPin, LOW); //Yeni dalgaların üretilmemesi için trig pini LOW konumuna getirildi

sure = pulseIn(echoPin, HIGH); //ses dalgasının geri dönmesi için geçen sure ölçülüyor
uzaklik = sure / 29.1 / 2; //ölçülen süre uzaklığa çevriliyor

Serial.println(uzaklik);

if (uzaklik < 15) // Uzaklık 15'den küçük ise,
{
geri(); // 150 ms geri git
delay(150);
sag(); // 250 ms sağa dön
delay(250);
}
}

void ileri()
{
digitalWrite(sol_ileri, 1);
digitalWrite(sag_ileri, 1);
digitalWrite(sol_geri, 0);
digitalWrite(sag_geri, 0);
analogWrite(sol_hiz, motorlar_hiz);
analogWrite(sag_hiz, motorlar_hiz);
}

void geri()
{
digitalWrite(sol_ileri, 0);
digitalWrite(sag_ileri, 0);
digitalWrite(sol_geri, 1);
digitalWrite(sag_geri, 1);
analogWrite(sol_hiz, motorlar_hiz);
analogWrite(sag_hiz, motorlar_hiz);
}

void sol()
{
digitalWrite(sol_ileri, 1);
digitalWrite(sag_ileri, 0);
digitalWrite(sol_geri, 0);
digitalWrite(sag_geri, 1);
analogWrite(sol_hiz, motorlar_hiz);
analogWrite(sag_hiz, motorlar_hiz);
}

void sag()
{
digitalWrite(sol_ileri, 0);
digitalWrite(sag_ileri, 1);
digitalWrite(sol_geri, 1);
digitalWrite(sag_geri, 0);
analogWrite(sol_hiz, motorlar_hiz);
analogWrite(sag_hiz, motorlar_hiz);
}
void dur()
{
digitalWrite(sol_ileri, 0);
digitalWrite(sag_ileri, 0);
digitalWrite(sol_geri, 0);
digitalWrite(sag_geri, 0);
analogWrite(sol_hiz, 0);
analogWrite(sag_hiz, 0);
}

void son_isleme_devam_et()
{
if (son_islem == 1)
{
ileri();
}
else if (son_islem == 2)
{
geri();
}
else if (son_islem == 3)
{
sol();
}
else if (son_islem == 4)
{
sag();
}
}
#akış #TeknoYardım

BeğenFavori PaylaşYorum yap

#Arduio ile BC-05 kullanan oldu mu ?

BeğenFavori PaylaşYorum yap
BeğenFavori PaylaşYorum yap
Önceki yorumları gör 5 / 8

Konu basit kurgusu basit ama arduino öğrenmek isteyenler için çok iyi bir çalışma koddaki neden ve nasıl yapıldılar üzerinde düşünülürse çok eğitici olur yeni başlıyanlara

#define analogPin A1 //Our pin for measuring
#define chargePin 3 //Pin for charging the cap
#define dischargePin 7 //Pin for discharging the cap
#define button 5 //Our button read pin
#define resistorValue 220.0F //Our charge resistor value. The f is there to tell the compiler it's a float

unsigned long startTime; //Used for
unsigned long elapsedTime; //measuring cap charge time
float microFarads; //Here we store the meausred value
float nanoFarads; //If it's small we convert it to nF

void setup(){
pinMode(chargePin, OUTPUT);/*
This sets the internal impendence of the chargePin to low. What this means
is that the current will come to less resistance when passing trough the
pin, wich will enable us to source(charge the cap) or sink(discharge the
cap) with current up to 40mA. If we set the pinMode to input, we enable
high impendence mode and the current will be bearly able to pass trough
the pin, we use it to "open" the ciruit (alltough the current will still
flow trough the pins, the equivalent wouldnt be an open circut, reather
a very big value resistor).
*/
digitalWrite(chargePin, LOW); //In LOW state it doesnt discharge the cap
pinMode(button, INPUT_PULLUP); /*We use INPUT_PULLUP when we have a button connected to the
pin, but without a external pullup resistor. We must have a either pull-up or pull-down
resistor to keep the pins from "floating", a state where pins will catch surrounding ele-
ctromagnetic fields, or get parasitic capactinance from sorrounding pins. MCU's have allready
built in pull up resostors we only need to connect the switch between the pin and ground.
*/
Serial.begin(9600); //Start the serial communication
}

void loop(){
if(!digitalRead(button)){ //When we press the button
digitalWrite(chargePin, HIGH); //This charges the capacitor
startTime = millis(); //The time when the cap starts to charge
while(analogRead(analogPin) 1){ //If the value is in uF
Serial.print((long)microFarads); //Print the stored value
Serial.println(" microFarads");
}
else{ //If smaller, we convert it to mF
nanoFarads = microFarads * 1000.0;
Serial.print((long)nanoFarads);
Serial.println(" nanoFarads");
}
digitalWrite(chargePin, LOW);//We do not charge the cap anymore
pinMode(dischargePin, OUTPUT); //Now we use
digitalWrite(dischargePin, LOW); //this pin for discharging
while(analogRead(analogPin) > 0); //Do nothing until the cap is discharged
pinMode(dischargePin, INPUT); //This "blocks" the discharge pin, as it is no longer needed
delay(150); //Delay so there is enough time to lift the finger from the button
}
}

BeğenFavori PaylaşYorum yap

L298N motor sürücü kullanan oldu mu ? Olduysa yardım.
#Arduino #TeknoYardım

BeğenFavori PaylaşYorum yap
Önceki yorumları gör 26 / 27

#ti #launchpad #msp430 #programlama #kulucka #termostat #teknoyardım #akış
Merhaba arkadaşlar,
Kuluçka makinesi yapmaya karar verdim. Malzemeleri yarın alacağım. Tamamen hobi amaçlı ve tek seferde en fazla 15 yumurta çıkartmayı planlıyorum. Gerekli araştırmalarımı yaptım. Kafamda planı oluşturdum.

Sizlere danışmak istediğim konu ise şu;
Dijital termostat almak yerine, termostatı kendim yapmayı planlıyorum. Elimde Launchpad MSP430 var. Bir adet röle ve bir de sıcaklık sensörü ile rahatlıkla yapabileceğimi düşünüyorum. Sadece sıcaklık değerini okuyacak, eğer 37,5'den küçükse röle pini HIGH, 37,7'den büyük ise LOW olacak. Bunu biliyorum fakat proglamlama bilgim çok az. Yani bu söylediğimi nasıl kodlarım bilmiyorum. Bu konuda yardımcı olabilirseniz sevinirim.

BeğenFavori PaylaşYorum yap
Önceki yorumları gör 41 / 42

Arduino hakkında yardımcı olabilecek bi hayır sever varmı ?

BeğenFavori PaylaşYorum yap
Önceki yorumları gör 19 / 25
  • erenahmtt @erenahmtt

    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?

    • erenahmtt @erenahmtt

      @onrdrsy üstadım anlamadım ? nasıl yazıyım ?

    • erenahmtt @erenahmtt

      @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();
      }
      }

    • Yükleniyor... @144p

      @erenahmtt bu şekilde demek istedim.

    • erenahmtt @erenahmtt

      @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

  • erenahmtt @erenahmtt

    @frt umarım kodlar doğu gelmiştir

  • erenahmtt @erenahmtt

    @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 ?