Skip to content

Commit f74057e

Browse files
author
David Oliver
committed
Adaptacion ejemplos para funcionar con pcbino_base
1 parent bcdd7ac commit f74057e

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

examples/CANReceiver/CANReceiver.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
// Selección del hardware a utilizar
5+
#define HW_RTLS_V4_0_X
6+
// #define HW_RTLS_V4_1_X
7+
48
#include <CAN.h>
9+
#include "boards.h"
510

611
void setup() {
7-
Serial.begin(9600);
8-
while (!Serial);
12+
Serial.begin(57600);
913

1014
Serial.println("CAN Receiver");
1115

16+
CAN.setPins( A_GPIO_5, GPIO_INT1 );
17+
1218
// start the CAN bus at 500 kbps
1319
if (!CAN.begin(500E3)) {
1420
Serial.println("Starting CAN failed!");

examples/CANReceiverCallback/CANReceiverCallback.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
// Selección del hardware a utilizar
5+
#define HW_RTLS_V4_0_X
6+
// #define HW_RTLS_V4_1_X
7+
48
#include <CAN.h>
9+
#include "boards.h"
510

611
void setup() {
7-
Serial.begin(9600);
8-
while (!Serial);
12+
Serial.begin(57600);
913

1014
Serial.println("CAN Receiver Callback");
1115

16+
CAN.setPins( A_GPIO_5, GPIO_INT1 );
17+
1218
// start the CAN bus at 500 kbps
1319
if (!CAN.begin(500E3)) {
1420
Serial.println("Starting CAN failed!");

examples/CANSender/CANSender.ino

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
// Copyright (c) Sandeep Mistry. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

4+
// Selección del hardware a utilizar
5+
#define HW_RTLS_V4_0_X
6+
// #define HW_RTLS_V4_1_X
7+
48
#include <CAN.h>
9+
#include "boards.h"
510

611
void setup() {
7-
Serial.begin(9600);
8-
while (!Serial);
12+
Serial.begin(57600);
913

1014
Serial.println("CAN Sender");
1115

16+
CAN.setPins( A_GPIO_5, GPIO_INT1 );
17+
1218
// start the CAN bus at 500 kbps
1319
if (!CAN.begin(500E3)) {
1420
Serial.println("Starting CAN failed!");
@@ -36,11 +42,12 @@ void loop() {
3642
Serial.print("Sending extended packet ... ");
3743

3844
CAN.beginExtendedPacket(0xabcdef);
39-
CAN.write('w');
40-
CAN.write('o');
41-
CAN.write('r');
42-
CAN.write('l');
43-
CAN.write('d');
45+
CAN.write('W');
46+
CAN.write('I');
47+
CAN.write('T');
48+
CAN.write('R');
49+
CAN.write('A');
50+
CAN.write('C');
4451
CAN.endPacket();
4552

4653
Serial.println("done");

0 commit comments

Comments
 (0)