diff --git a/strandstring/strandstring.pde b/strandstring/strandstring.pde index c2e348e1c183ea7241e11c75332e4b678716c43a..592a3d9c74a3399e9252f62413caaecae1d84b1a 100644 --- a/strandstring/strandstring.pde +++ b/strandstring/strandstring.pde @@ -1,16 +1,12 @@ // // -// serial_button.c -// -// 115200 baud FTDI connection that outputs '0' or '1' depending -// on the state of a physical button -// +// 115200 baud FTDI connection // set lfuse to 0x5E for 20 MHz xtal // // Neil Gershenfeld // 12/8/10 // Erik Strand -// 11/26/2018 +// 11/26/2018 and beyond // #include <avr/io.h> #include <util/delay.h> @@ -36,7 +32,7 @@ #define serial_pin_out (1 << PA1) #define led_pin (1 << PB2) -#define button_pin (1 << PA7) +//#define button_pin (1 << PA7) // this is no longer a button #define max_buffer 25 @@ -158,23 +154,14 @@ void setup(void) { DDRB |= led_pin; // Configure button_pin as an input. - DDRA &= ~button_pin; + //DDRA &= ~button_pin; // Activate button_pin's pullup resistor. - PORTA |= button_pin; + //PORTA |= button_pin; } void loop(void) { - if (PINA & button_pin) { - // Turn off the LED. - PORTB &= ~led_pin; - //put_char(&serial_port, serial_pin_out, '0'); - } else { - PORTB |= led_pin; - //put_char(&serial_port, serial_pin_out, '1'); - } - byte i; byte present = 0; byte type_s; @@ -185,7 +172,9 @@ void loop(void) { if (!ds.search(addr)) { put_line(&serial_port, serial_pin_out, "No more addresses."); ds.reset_search(); + PORTB |= led_pin; delay(250); + PORTB &= ~led_pin; return; }