-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modified file structure to conform with the Arduino Library Manager f…
…older layout
- Loading branch information
peter.pinter
committed
May 13, 2020
1 parent
36da8e7
commit 8fcf4d5
Showing
6 changed files
with
73 additions
and
73 deletions.
There are no files selected for viewing
126 changes: 63 additions & 63 deletions
126
...van_monitor/esp32_arduino_van_monitor.ino → ...van_monitor/esp32_arduino_van_monitor.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.