Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
strandstring
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Erik Strand
strandstring
Commits
ad547ed8
Commit
ad547ed8
authored
May 11, 2019
by
Erik Strand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment out button code
parent
ec36280d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
strandstring/strandstring.pde
strandstring/strandstring.pde
+7
-18
No files found.
strandstring/strandstring.pde
View file @
ad547ed8
//
//
// 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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment