Skip to content
Snippets Groups Projects
Commit ad547ed8 authored by Erik Strand's avatar Erik Strand
Browse files

Comment out button code

parent ec36280d
Branches
No related tags found
No related merge requests found
// //
// //
// serial_button.c // 115200 baud FTDI connection
//
// 115200 baud FTDI connection that outputs '0' or '1' depending
// on the state of a physical button
//
// set lfuse to 0x5E for 20 MHz xtal // set lfuse to 0x5E for 20 MHz xtal
// //
// Neil Gershenfeld // Neil Gershenfeld
// 12/8/10 // 12/8/10
// Erik Strand // Erik Strand
// 11/26/2018 // 11/26/2018 and beyond
// //
#include <avr/io.h> #include <avr/io.h>
#include <util/delay.h> #include <util/delay.h>
...@@ -36,7 +32,7 @@ ...@@ -36,7 +32,7 @@
#define serial_pin_out (1 << PA1) #define serial_pin_out (1 << PA1)
#define led_pin (1 << PB2) #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 #define max_buffer 25
...@@ -158,23 +154,14 @@ void setup(void) { ...@@ -158,23 +154,14 @@ void setup(void) {
DDRB |= led_pin; DDRB |= led_pin;
// Configure button_pin as an input. // Configure button_pin as an input.
DDRA &= ~button_pin; //DDRA &= ~button_pin;
// Activate button_pin's pullup resistor. // Activate button_pin's pullup resistor.
PORTA |= button_pin; //PORTA |= button_pin;
} }
void loop(void) { 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 i;
byte present = 0; byte present = 0;
byte type_s; byte type_s;
...@@ -185,7 +172,9 @@ void loop(void) { ...@@ -185,7 +172,9 @@ void loop(void) {
if (!ds.search(addr)) { if (!ds.search(addr)) {
put_line(&serial_port, serial_pin_out, "No more addresses."); put_line(&serial_port, serial_pin_out, "No more addresses.");
ds.reset_search(); ds.reset_search();
PORTB |= led_pin;
delay(250); delay(250);
PORTB &= ~led_pin;
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment