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
#include <OBD2.h> | |
#include <DueTimer.h> | |
#include "SamNonDuePin.h" | |
/******************************************************************** | |
This example is built upon the CANAcquisition class and the OBDParmameter class using extended OBD2 ID's | |
This example shows how to set up periodic data acquisition of OBD2 paramters based upon | |
standard PID's. If you'd like to add another paramter,simply copy one of the definitions and modify it accordingly. | |
You may also need to add a new PID to the "OBD_PID" enum in the header file. | |
/********************************************************************/ |
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 is a VERY quick sketch as a proof of concept to see if we can start a car via SWCAN. This code won't work as-is, the data shown is dummy data. | |
#include <mcp_can.h> | |
#include <SPI.h> | |
#include "SamNonDuePin.h" | |
const int Red = 32; | |
const int Yellow1 = X0; | |
const int Yellow2 = 27; | |
const int Green = 23; |
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
#define MASTER_CLOCK 84000000 | |
#include "SamNonDuePin.h" | |
uint32_t clock_a = 42000000; // Sampling frequency in Hz | |
int brightness = 0; // how bright the LED is | |
int fadeAmount = 5; // how many points to fade the LED by | |
const int IOENABLE = 6; // the number of the 12Vio_EN pin |
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
/* | |
Fade | |
Modified 6/6/16 to demonstrate Macchina 2.0 RGB LEDs, | |
also functioning as a HELLO WORLD type sketch. | |
This example shows how to fade an LED on the RGB LED | |
using the analogWrite() function. | |
The analogWrite() function uses PWM, so if |
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
#include "SamNonDuePin.h" | |
const int LPC = PIN_EMAC_ERX0; // LOW POWER CONTROL pin | |
void setup() { | |
pinModeNonDue(LPC, OUTPUT); | |
digitalWriteNonDue(LPC, LOW); // LOW = no power at +12V_SW/+5V_SW | |
// HIGH = power at +12V_SW/+5V_SW | |
} |
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
#include "SamNonDuePin.h" | |
const int LPC = PIN_EMAC_ERX0; // LOW POWER CONTROL pin | |
const int PWM_nVPW = PIN_EMAC_EMDC; // PWM/VPW level control | |
void setup() { | |
pinModeNonDue(LPC, OUTPUT); | |
pinModeNonDue(PWM_nVPW, OUTPUT); | |
digitalWriteNonDue(LPC, HIGH); // LOW = no power at +12V_SW/+5V_SW |
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
/* | |
Heavily modified from below code - works with NEOPIXEL 24 pos ring and M2 hardware. | |
Program Name: blueShift | |
Version: v0.7 | |
Author: Pete Mills | |
Website: petemills.blogspot.com | |
Email: mills.pete@gmail.com |
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
/* | |
* Example based on code found here. | |
* https://github.com/iwanders/OBD9141 | |
* | |
* Put the "OBD9141 in Libraries folder. | |
* | |
*/ | |
#include "OBD9141.h" | |
#include "SamNonDuePin.h" |
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
// Demo showing how to send CAN message to make flashers flash in 2006 Ford Fusion. | |
#include "variant.h" | |
#include <due_can.h> | |
#include "SamNonDuePin.h" | |
#define Serial SerialUSB | |
const int LOWPOW = PIN_EMAC_ERX0; |
NewerOlder