Skip to content

Commit

Permalink
Modified file structure to conform with the Arduino Library Manager f…
Browse files Browse the repository at this point in the history
…older layout
  • Loading branch information
peter.pinter committed May 13, 2020
1 parent 36da8e7 commit 8fcf4d5
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 73 deletions.
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
/* Arduino version of the ESP32 RMT VAN bus receive example,
* displaying the received VAN messages on the serial console
*
* The software is distributed under the MIT License
*
* Unless required by applicable law or agreed to in writing, this
* software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied.
*/
#include <esp32_arduino_rmt_van_rx.h>
#include <esp32_rmt_van_rx.h>

ESP32_RMT_VAN_RX VAN_RX;

const uint8_t VAN_DATA_RX_RMT_CHANNEL = 0;
const uint8_t VAN_DATA_RX_PIN = 21;
const uint8_t VAN_DATA_RX_LED_INDICATOR_PIN = 2;

uint8_t vanMessageLength;
uint8_t vanMessage[34];

uint32_t lastMillis = 0;

void setup()
{
Serial.begin(500000);
printf("ESP32 Arduino VAN bus monitor\n");

VAN_RX.Init(VAN_DATA_RX_RMT_CHANNEL, VAN_DATA_RX_PIN, VAN_DATA_RX_LED_INDICATOR_PIN, VAN_LINE_LEVEL_HIGH, VAN_NETWORK_TYPE_COMFORT);
//VAN_RX.Init(VAN_DATA_RX_RMT_CHANNEL, VAN_DATA_RX_PIN, VAN_DATA_RX_LED_INDICATOR_PIN, VAN_LINE_LEVEL_HIGH, VAN_NETWORK_TYPE_BODY);
}

void loop()
{
if (millis() - lastMillis > 5)
{
lastMillis = millis();
VAN_RX.Receive(&vanMessageLength, vanMessage);

if (vanMessageLength > 0)
{
if(VAN_RX.IsCrcOk(vanMessage, vanMessageLength))
{
for (size_t i = 0; i < vanMessageLength; i++)
{
if (i != vanMessageLength - 1)
{
printf("%02X ", vanMessage[i]);
}
else
{
printf("%02X", vanMessage[i]);
}
}
printf("\n");
}
else
{
printf("CRC ERROR!\n");
}
}
}
}
/* Arduino version of the ESP32 RMT VAN bus receive example,
* displaying the received VAN messages on the serial console
*
* The software is distributed under the MIT License
*
* Unless required by applicable law or agreed to in writing, this
* software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied.
*/
#include <esp32_arduino_rmt_van_rx.h>
#include <esp32_rmt_van_rx.h>

ESP32_RMT_VAN_RX VAN_RX;

const uint8_t VAN_DATA_RX_RMT_CHANNEL = 0;
const uint8_t VAN_DATA_RX_PIN = 21;
const uint8_t VAN_DATA_RX_LED_INDICATOR_PIN = 2;

uint8_t vanMessageLength;
uint8_t vanMessage[34];

uint32_t lastMillis = 0;

void setup()
{
Serial.begin(500000);
printf("ESP32 Arduino VAN bus monitor\n");

VAN_RX.Init(VAN_DATA_RX_RMT_CHANNEL, VAN_DATA_RX_PIN, VAN_DATA_RX_LED_INDICATOR_PIN, VAN_LINE_LEVEL_HIGH, VAN_NETWORK_TYPE_COMFORT);
//VAN_RX.Init(VAN_DATA_RX_RMT_CHANNEL, VAN_DATA_RX_PIN, VAN_DATA_RX_LED_INDICATOR_PIN, VAN_LINE_LEVEL_HIGH, VAN_NETWORK_TYPE_BODY);
}

void loop()
{
if (millis() - lastMillis > 5)
{
lastMillis = millis();
VAN_RX.Receive(&vanMessageLength, vanMessage);

if (vanMessageLength > 0)
{
if(VAN_RX.IsCrcOk(vanMessage, vanMessageLength))
{
for (size_t i = 0; i < vanMessageLength; i++)
{
if (i != vanMessageLength - 1)
{
printf("%02X ", vanMessage[i]);
}
else
{
printf("%02X", vanMessage[i]);
}
}
printf("\n");
}
else
{
printf("CRC ERROR!\n");
}
}
}
}
File renamed without changes
File renamed without changes.
9 changes: 9 additions & 0 deletions library.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name=ESP32 RMT Peripheral VAN bus reader library
version=1.0.0
author=Peter Pinter <[email protected]>
maintainer=Peter Pinter <[email protected]>
sentence=ESP32 RMT Peripheral VAN bus reader library
paragraph=It is intended to interface the automotive bus used in cars made by the PSA (Peugeot and Citroen)
category=Communication
url=https://github.com/morcibacsi/esp32_rmt_van_rx
architectures=esp32
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This library is built around the [RMT (Remote control) peripheral][rmt_periphera

### Schematics

![schema](https://github.com/morcibacsi/esp32_rmt_van_rx/raw/master/schema/esp32-sn65hvd230-iso-a.png)
![schema](https://github.com/morcibacsi/esp32_rmt_van_rx/raw/master/extras/schema/esp32-sn65hvd230-iso-a.png)

### Arduino
Copy the following files to your **documents\Arduino\libraries\esp32_arduino_rmt_van_rx** folder
Expand Down
9 changes: 0 additions & 9 deletions src/library.properties

This file was deleted.

0 comments on commit 8fcf4d5

Please sign in to comment.