قسم الميكروكنترولر والروبوت ودوائر الاتصال بالحاسب الالي قسم المتحكمات الـ microcontroller و المعالجات microprocessor و التحكم الرقمي بالكمبيوتر CNC والانظمة الآلية والروبوت Robots

أدوات الموضوع

haiman
:: مهندس ::
تاريخ التسجيل: Apr 2010
المشاركات: 13
نشاط [ haiman ]
قوة السمعة:0
قديم 08-08-2013, 07:47 PM المشاركة 1   
افتراضي (اردوينو ) مساعدة فى Bluetooth shield موديل HC-05 Twitter FaceBook Google+



السلام عليكم
مساعدة فى Bluetooth shield موديل HC-05
انا عملت الاعدادات وكل شىء والموبايل بيشوفها ويتصل بيها
ولكن عند الارسال من الموبايل الى الاردوينو بيطهر الحروف عبارة عن سيمبول ولو بعت من السيريال مونيتور الى الاردوينوا بيظهر برده على الموبايل سيمبول زى اللى فى الصورة




ياريت لو حد يعرف يديلنى على الغلط اللى انا عامله مع العلم انى كاتب الكود اللى فى الموقع المصنع للبلوتوث
وده هو الكود

كود:
/*********************************************************************
 **  Description:                                                    **
 **  This file is a sample code for your reference.                  **
 **                                                                  **
 **  Copyright (C) 2011 ElecFreaks Corp.                             **
 **  Created by ElecFreaks Robi.W /29 Sep 2011                      **
 **                                                                  **
 **  http://www.elecfreaks.com                                       **
 *********************************************************************/
#include <SoftwareSerial.h>
#include <TimerOne.h>
#define rxPin 2
#define txPin 3

SoftwareSerial mySerial(rxPin, txPin);
 
void Callback()
{
   Serial.println("------->  Callback Send AT");
   mySerial.print("AT\r\n");
}
 
void setup()
{
   // define pin modes for tx, rx pins:
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   mySerial.begin(9600);
   Serial.begin(9600);
 
   //Timer1.initialize(2000000);             // setting callback is 2s
   //Timer1.attachInterrupt(Callback); 
}
 
void loop()
{
  int i = 0;
  char someChar[32] = {0};
  // when characters arrive over the serial port...
  if(Serial.available()) {
    do{
      someChar[i++] = Serial.read();
      //As data trickles in from your serial port you are grabbing as much as you can, 
      //but then when it runs out (as it will after a few bytes because the processor 
      //is much faster than a 9600 baud device) you exit loop, which then restarts, 
      //and resets i to zero, and someChar to an empty array.So please be sure to keep this delay 
      delay(3);                  
 
    }while (Serial.available() > 0);
 
    mySerial.println(someChar);
    Serial.println(someChar);
  }
 
  while(mySerial.available()) 
      Serial.print((char)mySerial.read());    
}


التعديل الأخير تم بواسطة : haiman بتاريخ 08-08-2013 الساعة 07:51 PM
اعلانات

BOB_91
:: مهندس متواجد ::
تاريخ التسجيل: Aug 2013
المشاركات: 51
نشاط [ BOB_91 ]
قوة السمعة:0
قديم 24-01-2014, 06:18 PM المشاركة 2   
افتراضي


لو سمحت لو عرفت حل للمشكله دى ياريت تقولوا لان انا عندى نفس المشكله

اعلانات اضافية ( قم بتسجيل الدخول لاخفائها )
  

haiman
:: مهندس ::
تاريخ التسجيل: Apr 2010
المشاركات: 13
نشاط [ haiman ]
قوة السمعة:0
قديم 25-01-2014, 02:27 PM المشاركة 3   
افتراضي


اتفضل اخى الغالى
الحمد لله انا شغلتها وعملت التطبيق بتاعها وطلع كويس
وده الكود

كود:
#include <SoftwareSerial.h>
 
/* DIO used to communicate with the Bluetooth module's TXD pin */
#define BT_SERIAL_TX_DIO 2
/* DIO used to communicate with the Bluetooth module's RXD pin */
#define BT_SERIAL_RX_DIO 3
 
/* Initialise the software serial port */
SoftwareSerial BluetoothSerial(BT_SERIAL_TX_DIO, BT_SERIAL_RX_DIO);
 
void setup()
{
  /* Set the baud rate for the hardware serial port */
  Serial.begin(38400);
  /* Set the baud rate for the software serial port */
  BluetoothSerial.begin(38400);
 
}
 
/* Main loop that will pass any data to and from the Bluetooth mode to the
   host PC */
void loop()
{
  /* If data is available from the Bluetooth module then pass it on to the
     hardware serial port. */
  if (BluetoothSerial.available())
    Serial.write(BluetoothSerial.read());
 
   /* If data is available from the hardware serial port then pass it on
      to the Bluetooth module. */
  if (Serial.available())
    BluetoothSerial.write(Serial.read());
}

وده التطبيق

طبعا الكود اللى انا بعته ده لتشغيل ابلوتوث شيلد فقط
لكن لو عوزت اى كود خبرنى ببيه وانا ارسله لك ان شاء الله


BOB_91
:: مهندس متواجد ::
تاريخ التسجيل: Aug 2013
المشاركات: 51
نشاط [ BOB_91 ]
قوة السمعة:0
قديم 25-01-2014, 04:23 PM المشاركة 4   
ha


اتفضل اخى الغالى
الحمد لله انا شغلتها وعملت التطبيق بتاعها وطلع كويس
وده الكود

كود:
#include <SoftwareSerial.h>
 
/* DIO used to communicate with the Bluetooth module's TXD pin */
#define BT_SERIAL_TX_DIO 2
/* DIO used to communicate with the Bluetooth module's RXD pin */
#define BT_SERIAL_RX_DIO 3
 
/* Initialise the software serial port */
SoftwareSerial BluetoothSerial(BT_SERIAL_TX_DIO, BT_SERIAL_RX_DIO);
 
void setup()
{
  /* Set the baud rate for the hardware serial port */
  Serial.begin(38400);
  /* Set the baud rate for the software serial port */
  BluetoothSerial.begin(38400);
 
}
 
/* Main loop that will pass any data to and from the Bluetooth mode to the
   host PC */
void loop()
{
  /* If data is available from the Bluetooth module then pass it on to the
     hardware serial port. */
  if (BluetoothSerial.available())
    Serial.write(BluetoothSerial.read());
 
   /* If data is available from the hardware serial port then pass it on
      to the Bluetooth module. */
  if (Serial.available())
    BluetoothSerial.write(Serial.read());
}
وده التطبيق
Smart control by Eng. Haiman Adel - YouTube

طبعا الكود اللى انا بعته ده لتشغيل ابلوتوث شيلد فقط
لكن لو عوزت اى كود خبرنى ببيه وانا ارسله لك ان شاء الله
شكرا جدا بس انا كنت عايز اوصل اشاره عن طريق اللاب توب لما ادوس على زرار W مثلا ينور ليد اشيل ايدى يطفى الليد بس مش قادر افهم الشيلد اللى معايا ده
<a href="http://www.freeimagehosting.net/"><img src="http://www.freeimagehosting.net/newuploads/fulqp.jpg" alt="Free Web Proxy"></a>
لو حضرتك تقدر تقولى ايه pins اللى انا عامل عليها سهم دى و ايه علاقتهم ب ال RX و TX
و ازاى ابعت اشاره من بلوتوث اللابتوب للاردوينوا عن طريق البلوتوث شيلد يبقى شكرا جدا جدا
و شكرا على المساعده


BOB_91
:: مهندس متواجد ::
تاريخ التسجيل: Aug 2013
المشاركات: 51
نشاط [ BOB_91 ]
قوة السمعة:0
قديم 25-01-2014, 04:40 PM المشاركة 5   
افتراضي


http://animalslovers.com/upload/uplo...0667935141.jpg'

هو ده اللى انا شغال بيه
مع بورده اردوينوا اونو

إضافة رد

العلامات المرجعية

«     الموضوع السابق       الموضوع التالي    »
أدوات الموضوع

الانتقال السريع إلى


الساعة معتمدة بتوقيت جرينتش +3 الساعة الآن: 05:36 AM
موقع القرية الالكترونية غير مسؤول عن أي اتفاق تجاري أو تعاوني بين الأعضاء
فعلى كل شخص تحمل مسئولية نفسه إتجاه مايقوم به من بيع وشراء وإتفاق وأعطاء معلومات موقعه
التعليقات المنشورة لا تعبر عن رأي موقع القرية الالكترونية ولايتحمل الموقع أي مسؤولية قانونية حيال ذلك (ويتحمل كاتبها مسؤولية النشر)

Powered by vBulletin® Version 3.8.6, Copyright ©2000 - 2025