极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 23966|回复: 9

arduino nano v3.3 通過藍牙發送到 PC

[复制链接]
发表于 2013-3-8 23:50:11 | 显示全部楼层 |阅读模式
本帖最后由 killerlay 于 2013-3-8 23:59 编辑


http://item.taobao.com/item.htm?id=4925458343&ali_trackid=2:mm_27963266_0_0:1358909124_4k4_1128082758
--------------taobao-SD卡读写模块单片机 SD SPI接口 SD卡插座 SD卡读写模块

http://itemtaobao.com/item.htm?spm=a230r.1.10.121.GLOlNo&id=19701244981
-----Nano-v3.0

http://tradearchive.taobao.com/trade/detail/tradeSnap.htm?spm=a1z09.2.9.42.9oE9we&tradeID=131334415469207        
  ---- ---blue tooth model



目標: 首先通過arduino -Nano 讀取 SD-CARD 的資料 ,之後讓Bluetooth 藍牙 傳到電腦上?

电路图已经有啦,只差完美的编程!编程一直都是我的死穴

新人入门还望大家多多幫忙,指点,給點意見!

感谢

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复

使用道具 举报

发表于 2013-3-9 09:26:05 | 显示全部楼层
使用USB读卡器!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-3-11 09:27:02 | 显示全部楼层
zintiger 发表于 2013-3-9 09:26
使用USB读卡器!

我就是不希望用那個,不可能每次都取下卡,然後插到USB 讀卡器吧,所以就想透過藍牙傳輸數據到PC.

小弟想問一個問題,這個可以同時發生的嗎,【一邊讀一邊傳數據】??
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-3-11 17:24:15 | 显示全部楼层
搞定咯:http://www.youtube.com/watch?v=lw49GbDPLXg
回复 支持 反对

使用道具 举报

发表于 2013-4-3 18:13:00 | 显示全部楼层
楼主,请教下我用是APM2.5 mega2560的板子读取跟你一样的SD卡,但接线,写代码发现没反应!!
引脚接线: SD卡            APM2.5板
           MISO  --------->    MISO(50)
                MOSI  ---------->   MOSI(51)
                SCK    ----------->  SCK(52)
                 CS     ---------->   PB6(12)               //这个是随便找个outpin接口用的
                           SS(53)                //文档上说不用要设为输出
代码:
#include <SD.h>
#include <SPI.h>

// On the Ethernet Shield, CS is pin 4. Note that even if it's not
// used as the CS pin, the hardware CS pin (10 on most Arduino boards,
// 53 on the Mega) must be left as an output or the SD library
// functions will not work.
// const int chipSelect =4 ;   
const int chipSelect = 12;
void setup()
{
  Serial.begin(9600);
  Serial.print("Initializing SD card...\n");
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
   //pinMode(10,out)
     pinMode(53, OUTPUT);
   
   
  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
       return;
  }
  
  Serial.println("card initialized.");

}
void loop()
{
    ....
}
错误是在打印“Card failed, or not present”这个信息,就没了!!求帮忙啦,先谢过!!!!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-4-3 22:23:30 | 显示全部楼层
Mrrr_lee 发表于 2013-4-3 18:13
楼主,请教下我用是APM2.5 mega2560的板子读取跟你一样的SD卡,但接线,写代码发现没反应!!
引脚接线:  ...

const int chipSelect = 53;
void setup()
{
  Serial.begin(9600);
  Serial.print("Initializing SD card...\n");
  // make sure that the default chip select pin is set to
  // output, even if you don't use it:
   //pinMode(10,out)
     pinMode(53, OUTPUT);
   
   
  // see if the card is present and can be initialized:
  if (!SD.begin(53)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
       return;
  }
  
  Serial.println("card initialized.");

}
void loop()
{
    ....
}
回复 支持 反对

使用道具 举报

发表于 2013-4-6 14:05:44 | 显示全部楼层
killerlay 发表于 2013-4-3 22:23
const int chipSelect = 53;
void setup()
{

按你的代码运行还是出现Card failed, or not present,错误!难道把SD卡的CS引脚接到APM板子的pin53,这个也是过了,也没用!!还是说SD卡的CS引脚要怎样接啊!!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-4-10 11:22:28 | 显示全部楼层
本帖最后由 killerlay 于 2013-4-10 12:24 编辑
Mrrr_lee 发表于 2013-4-6 14:05
按你的代码运行还是出现Card failed, or not present,错误!难道把SD卡的CS引脚接到APM板子的pin53,这个 ...


名字對接就對啦,不需要做什麼處理, 我用過這個code是沒問題的,可能你的電路有問題?確認一下:

SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS).


 或者還有你的電壓問題,介意給個圖片我看一下嗎
回复 支持 反对

使用道具 举报

发表于 2013-4-19 17:48:42 | 显示全部楼层
killerlay 发表于 2013-4-10 11:22
名字對接就對啦,不需要做什麼處理, 我用過這個code是沒問題的,可能你的電路有問題?確認一下:

S ...

麻烦帮我看看问题!!!
引脚接线: SD卡            APM2.5板
                 MISO  --------->    MISO(50)
                 MOSI  ---------->   MOSI(51)
                 SCK    ----------->  SCK(52)
                 CS     ---------->   PB6(12)               //这个是随便找个outpin接口用的
                 SS(53)                                         //文档上说不用要设为输出

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2014-3-21 17:12:01 | 显示全部楼层
楼主你好,能透露一下你是怎么实现一边保存数据,一边蓝牙发送的吗?我也想做这个,但是不会。谢谢啦。
9 3 6 1 0 5 0 1 (麻花疼)9
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-10 04:08 , Processed in 0.038554 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表