Skip to content

Commit

Permalink
Example updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ttlappalainen committed Jun 26, 2017
1 parent 7859f6a commit 5b2876a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Examples/ActisenseListenerSender/ActisenseListenerSender.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,25 @@

tActisenseReader ActisenseReader;

// Define READ_STREAM to port, where you write data from PC e.g. with NMEA Simulator.
#define READ_STREAM Serial
// Define ForwardStream to port, what you listen on PC side. On Arduino Due you can use e.g. SerialUSB
#define FORWARD_STREAM Serial

Stream *ReadStream=&READ_STREAM;
Stream *ForwardStream=&FORWARD_STREAM;

void setup() {
// Define buffers big enough
NMEA2000.SetN2kCANSendFrameBufSize(150);
NMEA2000.SetN2kCANReceiveFrameBufSize(150);

if (ReadStream!=ForwardStream) READ_STREAM.begin(115200);
FORWARD_STREAM.begin(115200);
NMEA2000.SetForwardStream(ForwardStream);
NMEA2000.SetMode(tNMEA2000::N2km_ListenAndSend);
// NMEA2000.SetForwardType(tNMEA2000::fwdt_Text); // Show bus data in clear text
if (ReadStream==ForwardStream) NMEA2000.SetForwardOwnMessages(false); // If streams are same, do not echo own messages.
// NMEA2000.EnableForward(false);
NMEA2000.Open();

Expand Down
9 changes: 9 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ Actisense message format handling I have learned from OpenSkipper project.
I also thank for anybody who has extended library with new PGNs or processor support.

== Changes ==
26.06.2017 Example updates

- ActisenseListenerSender can be used to listen and send data to NMEA 2000 bus. This is almost same as TeensyActisenseListenerSender,
but read and forward ports can be chosen with #define.

- ActisenseListener uses now SetN2kCANReceiveFrameBufSize.

- Removed FromPCToN2k. ActisenseListenerSender replaces this.

25.06.2017 Fix and cosmetic changes

- ForwardStream initialization was accidentaly deleted
Expand Down

0 comments on commit 5b2876a

Please sign in to comment.