Merge pull request #48 from adamvoss/markdownFixes

Fix Markdown rendering on GitHub
This commit is contained in:
Jack Shao
2017-08-16 02:58:44 -05:00
committed by GitHub
+14 -20
View File
@@ -5,6 +5,7 @@ CAN BUS Shield
<br>
CAN-BUS is a common industrial bus because of its long travel distance, medium communication speed and high reliability. It is commonly found on modern machine tools and as an automotive diagnostic bus. This CAN-BUS Shield adopts MCP2515 CAN Bus controller with SPI interface and MCP2551 CAN transceiver to give your Arduino/Seeeduino CAN-BUS capability. With an OBD-II converter cable added on and the OBD-II library imported, you are ready to build an onboard diagnostic device or data logger.
- Implements CAN V2.0B at up to 1 Mb/s
@@ -16,15 +17,13 @@ CAN-BUS is a common industrial bus because of its long travel distance, medium c
<br>
# Installation:
## Installation:
git clone https://github.com/Seeed-Studio/CAN_BUS_Shield.git
or download the zip.
<br>
# Usage:
## Usage:
@@ -35,7 +34,7 @@ CAN_BUS_Shield/examples.
## 1. Set the BaudRate
### 1. Set the BaudRate
This function is used to initialize the baudrate of the CAN Bus system.
@@ -61,9 +60,7 @@ The available baudrates are listed as follows:
#define CAN_1000KBPS 18
<br>
##2. Set Receive Mask and Filter
### 2. Set Receive Mask and Filter
There are 2 receive mask registers and 5 filter registers on the controller chip that guarantee you get data from the target device. They are useful especially in a large network consisting of numerous nodes.
@@ -80,8 +77,7 @@ We provide two functions for you to utilize these mask and filter registers. The
<br>
## 3. Check Receive
### 3. Check Receive
The MCP2515 can operate in either a polled mode, where the software checks for a received frame, or using additional pins to signal that a frame has been received or transmit completed. Use the following function to poll for received frames.
INT8U MCP_CAN::checkReceive(void);
@@ -90,8 +86,7 @@ The function will return 1 if a frame arrives, and 0 if nothing arrives.
<br>
## 4. Get CAN ID
### 4. Get CAN ID
When some data arrives, you can use the following function to get the CAN ID of the "send" node.
@@ -99,8 +94,7 @@ When some data arrives, you can use the following function to get the CAN ID of
<br>
## 5. Send Data
### 5. Send Data
CAN.sendMsgBuf(INT32U id, INT8U ext, INT8U len, INT8U *buf);
@@ -116,16 +110,15 @@ This is a function to send data onto the bus. In which:
For example, In the 'send' example, we have:
<pre>
```
unsigned char stmp[8] = {0, 1, 2, 3, 4, 5, 6, 7};
CAN.sendMsgBuf(0x00, 0, 8, stmp); //send out the message 'stmp' to the bus and tell other devices this is a standard frame from 0x00.
</pre>
```
<br>
## 6. Receive Data
### 6. Receive Data
The following function is used to receive data on the 'receive' node:
@@ -137,8 +130,8 @@ Under the condition that masks and filters have been set, this function will onl
**buf** is where you store the data.
<br>
## 7. Check additional flags
### 7. Check additional flags
When frame is received you may check whether it was remote request and whether it was an extended (29bit) frame.
@@ -149,6 +142,7 @@ When frame is received you may check whether it was remote request and whether i
<br>
For more information, please refer to [wiki page](http://www.seeedstudio.com/wiki/CAN-BUS_Shield).