Grove – Universal 4 Pin Unbuckled Cable 20公分無扣母對母連接線 (5條包裝) seeed
Grove – Universal 4 Pin 20cm Unbuckled Cable (5 PCs Pack)
無扣母對母連接線 (5條)
Grove – 4pin 20CM 無扣母對母連接線 (5條)本線材適用本公司所有 Grove 類型感測器與擴充卡。
本商品出貨一件為 5 條連接線為一個單位。
Grove – 4pin 20CM 無扣母對母連接線 (5條)本線材適用本公司所有 Grove 類型感測器與擴充卡。
本商品出貨一件為 5 條連接線為一個單位。
Grove – NFC Tag 是一款基於意法半導體M24LR64E-R集成解決方案的近場標籤模塊。通過I2C接口與主機通信,內建64位唯一識別碼同時集成了64Kbit EEPROM。模塊外擴了一個PCB天線,可以很方便安裝到您設計的結構中。
#include "NfcTag.h" #include <Wire.h> NfcTag nfcTag ; int led = 5 ; bool flag = false ; bool preFlag = false ; void setup ( ) { Serial . begin ( 9600 ) ; pinMode ( led, OUTPUT ) ; nfcTag. init ( ) ; } void loop ( ) { flag = nfcTag. readByte ( EEPROM_I2C_LENGTH - 1 ) == 0xff ? true : false ; if ( flag ! = preFlag ) { Serial . println ( "get remote NFC control signal!" ) ; if ( flag == true ) { Serial . println ( "led will light up!" ) ; digitalWrite ( led, HIGH ) ; } else { Serial . println ( "led will turn dark!" ) ; digitalWrite ( led, LOW ) ; } preFlag = flag ; } delay ( 5 * 1000 ) ; }
=========================================================
Grove – NFC Tag is a highly integrated Near Field Communication Tag module,this module is I2C interface,which base on M24LR64E-R,M24LR64E-R have a 64-bit unique identifier and 64 -Kbit EEPROM.Grove – NFC Tag attach an independent PCB antenna which can easily stretch out of any enclosure you use, leaving more room for you to design the exterior of your project.
Specifications
Grove – NFC 近場通訊 是指短距離的無線通訊技術,應用的場合包括門禁管理系統和移動支付系統。近場通訊模塊集成了PN532收發芯片,在13.56MHz下無需接觸即可通訊,支持讀寫工作在13.56MHz的標籤,或者兩個近場通訊模塊可以完成點對點通信。近場通訊模塊配有的通訊接口包括I2C和UART,UART為默認的通訊方式。另外,模塊的天線引出的設計,無論你使用哪種盒子,都能方便地引出天線,給其他的設計騰出空間。
下面介紹如何使用近場通訊模塊。
當然你也可以使用UART接口而不需要額外的切割工作,這種情況下最好使用Seeeduino Mega(Arduino Mega) or Seeeduino lite(Arduino Leonardo)。下面是更新的程序:
#include "PN532_HSU.h"
#include "PN532.h"
#include "NfcAdapter.h"
PN532_HSU interface ( Serial1 ) ;
NfcAdapter nfc = NfcAdapter ( interface ) ;
void setup ( void ) {
Serial . begin ( 115200 ) ;
Serial . println ( "NDEF Reader" ) ;
nfc. begin ( ) ;
}
void loop ( void ) {
Serial . println ( " n Scan a NFC tag n " ) ;
if ( nfc. tagPresent ( ) )
{
NfcTag tag = nfc. read ( ) ;
tag. print ( ) ;
}
delay ( 5000 ) ;
}
也可以使用Seeeduino或Arduino的UART接口和近場通訊模塊通訊,但無法使用串口監視器。
=========================================================
Near Field Communication (NFC) is a set of short-range wireless technologies. It’s behind daily applications such as access control system and mobile payment system.
Grove NFC features a highly integrated transceiver module PN532 which handles contactless communication at 13.56MHz. You can read and write a 13.56MHz tag with this module or implement point to point data exchange with two NFCs. Grove NFC is designed to use I2C or UART communication protocols, and UART is the default mode. In addition, we assign an independent PCB antenna which can easily stretch out of any enclosure you use, leaving more room for you to design the exterior of your project.
Specification
Part List
是一種利用超聲波測量距離的超聲波感測器。它的尺寸可以從3厘米到350厘米,精度可達2毫米。它 是一個完美的ü ltrasonic 用於距離測量,超聲波探測器。
與傳統的超聲波模組HC-SR04相比,Grove – 超聲波距離感測器集成了單片機,發送信號和接收信號通過時分複用共用一個引腳,因此只佔用一個I / O引腳。另一個區別是HC-SR04僅支持5v電壓,而Grove – 超聲波距離傳感器支持5v和3.3v。我們知道,Raspberry pi I / O僅支持3.3v。因此,Grove – 超聲波距離傳感器可以直接連接到Raspberry Pi的I / O,但HC-SR04需要使用電壓轉換電路。
Grove – 超聲波距離感測器與HC-SR04
更重要的是,我們為Arduino,Python和Codecraft提供完整的文檔,以便您可以輕鬆地使用Grove – 超聲波距離感測器與Arduino和 Raspberry pi。寬電壓範圍,單I / O引腳,即插即用Grove連接器。
這裡我們演示如何使用Grove – Ultrasonic Ranger來獲得距離信息,並打印到Grove – Serial LCD上。
如上圖所示,將Serial LCD連接到D4/D5接口,Ultrasonic Ranger連接到D7口。然後你需要從github上下載我們提供的Ultrasonic Ranger庫文件和用到的1Serial LCD庫文件,對於非Arduino自帶的庫文件,你需要將下載的庫文件安裝到Arduino的Library中,具體安裝步驟請參考wiki首頁的”如何安裝庫文件”課題。安裝完成後,通過路徑:File->Examples->UltrasonicRanger->examples->UltraDisOnSeeedSerialLcd打開代碼並上傳。
/************************************************* **************************/ // Function: Measure the distance to obstacles in front and display the // result on seeedstudio serialLcd. Make sure you installed the // serialLCD, SofewareSerial and Ultrasonic library. // Hardware: Grove - Ultrasonic Ranger, Grove - Serial LCD // Arduino IDE: Arduino-1.0 // Author: LG // Date: Jan 17,2013 // Version: v1.0 modified by FrankieChu // by www.seeedstudio.com /************************************************* ****************************/ #include <SoftwareSerial.h> #include <SerialLCD.h> #include "Ultrasonic.h" SerialLCD slcd(4,15); Ultrasonic ultrasonic(7); void setup() { slcd.begin(); } void loop() { long RangeInCentimeters; RangeInCentimeters = ultrasonic.MeasureInCentimeters(); delay(150); slcd.clear(); slcd.setCursor(0,0); slcd.print("The distance:"); slcd.setCursor(0,1) ; slcd.print(RangeInCentimeters,DEC); slcd.setCursor(5,1) ; slcd.print("cm"); }
在參考資料部分有這個demo的視頻教程,供你參考。
The Grove – Ultrasonic Distance Sensor is an ultrasonic transducer that utilizes ultrasonic waves to measures distance. It can measure from 3cm to 350cm with the accuracy up to 2mm. It is a perfect ultrasonic module for distance measurement, proximity sensors, and ultrasonic detector.
This module has an ultrasonic transmitter and an ultrasonic receiver so you can consider it as an ultrasonic transceiver. Familiar with sonar, when the 40KHz ultrasonic wave generated by the transmitter encounters the object, the sound wave will be emitted back, and the receiver can receive the reflected ultrasonic wave. It is only necessary to calculate the time from the transmission to the reception, and then multiply the speed of the sound in the air(340 m/s) to calculate the distance from the sensor to the object.
Compared with traditional ultrasonic modules HC-SR04, the Grove – Ultrasonic Distance Sensor integrates a single-chip microcomputer, and the transmitting signal and the receiving signal share one pin by time division multiplexing, so only one I/O pin is occupied. Another difference is that HC-SR04 only supports 5v voltage, while Grove – Ultrasonic Distance Sensor supports 5v and 3.3v. As we know, the Raspberry pi I/O only supports 3.3v. Therefore, Grove – Ultrasonic Distance Sensor can be directly connected to the I/O of the Raspberry Pi, but HC-SR04 needs to use a voltage conversion circuit.
What’s more, we provide full documents and libraries for Arduino, Python, and Codecraft so that you can use the Grove – Ultrasonic Distance Sensor with Arduino and Raspberry pi easily. Wide voltage range, single I/O pin, plug and play Grove connector, we try our best to make this module easier to use and reduce your work. This is exactly the philosophy of Grove: simple is the best. We hope you like it.
Seeed BLE Shield 是一款低功耗藍牙4.0傳輸模組。模塊採用的是TI CC2540 晶片,配置256Kb空間,支持AT指令。你可以將此模塊應用於遙控、遊戲手柄、數據無線採集、智慧家居等領域。同時作為Shield系列的一員,它能很方便的直插到開發板上使用。
直接將BLE Shield插入到Arduino/Seeeduino上. 請注意PCB板上跳帽的選擇.
當你使用不同代碼的時候,Seeed BLE Shield可以作為主機或從機。當使用軟串口通信時,即使用軟件代碼對BLE模塊進行通信時,跳帽的選擇應為:BLE_TX–>D2,BLE_RX–>D3.
然後打開Arduino IDE v1.0.5,複製以下主機或從機的代碼,並下載到主板中。 從機代碼
#include <SoftwareSerial.h> //Software Serial Port #define RxD 2 #define TxD 3 #define DEBUG_ENABLED 1 SoftwareSerial BLE(RxD,TxD); void setup() { Serial.begin(9600); pinMode(RxD, INPUT); pinMode(TxD, OUTPUT); setupBleConnection(); } void loop() { char recvChar; while(1){ if(BLE.available()){//check if there's any data sent from the remote BLE shield recvChar = BLE.read(); Serial.print(recvChar); } if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here recvChar = Serial.read(); BLE.print(recvChar); } } } void setupBleConnection() { BLE.begin(9600); //Set BLE BaudRate to default baud rate 9600 BLE.print("AT+CLEAR"); //clear all previous setting BLE.print("AT+ROLE0"); //set the bluetooth name as a slaver BLE.print("AT+SAVE1"); //don't save the connect information }
主機代碼
#include <SoftwareSerial.h> //Software Serial Port #define RxD 2 #define TxD 3 #define DEBUG_ENABLED 1 SoftwareSerial BLE(RxD,TxD); void setup() { Serial.begin(9600); pinMode(RxD, INPUT); pinMode(TxD, OUTPUT); setupBleConnection(); } void loop() { char recvChar; while(1){ if(BLE.available()){//check if there's any data sent from the remote BLE shield recvChar = BLE.read(); Serial.print(recvChar); } if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here recvChar = Serial.read(); BLE.print(recvChar); } } } void setupBleConnection() { BLE.begin(9600); //Set BLE BaudRate to default baud rate 9600 BLE.print("AT+CLEAR"); //clear all previous setting BLE.print("AT+ROLE1"); //set the bluetooth name as a master BLE.print("AT+SAVE1"); //don't save the connect information }
當然,你可以通過AT指令直接對BLE模塊進行操作,而不需要使用任何代碼。但需要注意跳帽的位置:BLE_TX–>D1,BLE_RX–>D2。
然後打開串口工具,比如MAC版用戶可以打開CoolTerm串口助手,PC版用戶可打開Sscom32串口工具。串口工具的設置如下:Baudrate: 9600(default) , Data Bits: 8, Parity: none, Stop Bits: 1
你可以發送指令”AT”進行測試,如果返回“OK”,即能夠通信。如果沒有返回任何值,用戶可以嘗試燒錄一個空程序到主板上,然後再發送指令“AT”進行測試。
void setup() { } void loop() { }
確認可以通信之後,便可以發送AT指令給BLE模塊了。比如設置BLE模塊為從機,發送指令“AT+ROLE0”,如果返回“OK+Set:0”,即表示BLE模塊已設置成功。
所有的AT指令都包含在以下的資源版塊的BLE模塊data sheet中,用戶請自行下載查閱。