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

Comment out button code

parent ec36280d
No related branches found
No related tags found
No related merge requests found
//
//
// 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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment