grease_lighting
Well-known member
I'm making a battery powered project and am using pin D13 to turn it off via the touch screen. I find the when using Ethernet.begin, it interferes with the state of pin D13, causing it to go low. I've re-assigned the SCK pin to pin #14. Short of re-assigning a bunch of pins does anyone know what is causing this?
Code:
#include <SPI.h>
#include "T3Mac.h" // Use Teensy MAC address as Ethernet MAC address data in mac[x]
#include <Ethernet.h>
#define PWRoff 13 // power off (by Teensy) control pin. LOW == off Otherwise HIGH
#define ethRst 9 // WIZ820/850 reset pin (#9)
#define ethCs 10 // WIZ820/850 CS pin (D10, -1 to inhibit) // if unit is present, it must be initialized
IPAddress ip(192, 168, 103, 177); // IP of teensy
void setup() {
pinMode(PWRoff, OUTPUT);
digitalWrite(PWRoff, HIGH);
SPI.setSCK(14); // use alternate pin for SCK-0
SPI.begin();
delay(5000);
Ethernet.begin(mac, ip);
}
void loop() {
}