particle-mf2017-can (community library)

Summary

Name Value
Name particle-mf2017-can
Version 1.3.2
Installs
License MIT
Author Julien Vanier jvanier@gmail.com
URL https://github.com/spark/particle-mf2017-can
Repository https://github.com/spark/particle-mf2017-can.git
Download .tar.gz
All Versions 1.3.2, 1.3.1, 1.3.0, 1.2.1, 1.2.0, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0

Particle Machine Maker Faire 2017 CAN Communication

Example Build Testing

Device OS Version:

This table is generated from an automated build. Success only indicates that the code compiled successfully.

Library Read Me

This content is provided by the library maintainer and has not been validated or approved.

Particle Maker Faire 2017 Machine Communication

Share state between all machine modules over CAN.

Overview

Create a Communication object. Read variables that contain state from other modules you care about, write state about your own module. Call receive() to update other module states and transmit(MachimeModules::<my_module>) to send your own state to other modules.

#include "mf2017-can.h"

Communication comms;

void setup() {
pinMode(D0, INPUT);
comms.begin();
}

void loop() {
// Send your state
comms.ballsEntering[0] = digitalRead(D0);
// Read other state
if (comms.machineState == 0) {
// disable this station
}

// Update CAN bus
comms.receive();
comms.transmit(MachineModules::Station1);
}

LICENSE

Copyright 2017 Particle

Licensed under the MIT license

Browse Library Files