Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hugo.garza
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Academany
Fab Academy
2020
Fab Academy 2020 Labs
Ciudad de México
Ciudad de Mexico students
hugo.garza
Commits
e07b3af9
Commit
e07b3af9
authored
2 years ago
by
HGWcommit
Browse files
Options
Downloads
Patches
Plain Diff
Create embedded_v3.ino
parent
219deeb3
No related branches found
No related tags found
No related merge requests found
Pipeline
#331283
passed
2 years ago
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
embedded_v3/embedded_v3.ino
+75
-0
75 additions, 0 deletions
embedded_v3/embedded_v3.ino
with
75 additions
and
0 deletions
embedded_v3/embedded_v3.ino
0 → 100644
+
75
−
0
View file @
e07b3af9
/*
created 2005
by DojoDave <http://www.0j0.org>
modified 30 Aug 2011
by Tom Igoe
*/
// constants won't change. They're used here to set pin numbers:
const
int
buttonPin
=
4
;
// the number of the pushbutton pin
const
int
ledPin
=
2
;
// the number of the LED pin
int
aux
=
0
;
// variables will change:
int
buttonState
=
0
;
// variable for reading the pushbutton status
//aqui voy a indicar que es salida o entrada por ejemplo: Servo, LDR, LED INPUT o OUTPUT
void
setup
()
{
// initialize the LED pin as an output:
pinMode
(
ledPin
,
OUTPUT
);
// initialize the pushbutton pin as an input:
pinMode
(
buttonPin
,
INPUT
);
}
//este es el ciclo, lo que se va a estar ejecutando, de arriba a abajo y vuelve a empezar
void
loop
()
{
// read the state of the pushbutton value:
buttonState
=
digitalRead
(
buttonPin
);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if
(
aux
==
0
&
buttonState
==
HIGH
){
// turn LED on:
digitalWrite
(
ledPin
,
HIGH
);
delay
(
1000
);
digitalWrite
(
ledPin
,
LOW
);
delay
(
1000
);
digitalWrite
(
ledPin
,
HIGH
);
delay
(
1000
);
digitalWrite
(
ledPin
,
LOW
);
aux
++
;
buttonState
=
0
;
}
if
(
aux
==
1
&
buttonState
==
HIGH
){
digitalWrite
(
ledPin
,
HIGH
);
delay
(
500
);
digitalWrite
(
ledPin
,
LOW
);
delay
(
500
);
digitalWrite
(
ledPin
,
HIGH
);
delay
(
500
);
digitalWrite
(
ledPin
,
LOW
);
delay
(
500
);
digitalWrite
(
ledPin
,
HIGH
);
delay
(
500
);
digitalWrite
(
ledPin
,
LOW
);
delay
(
500
);
digitalWrite
(
ledPin
,
HIGH
);
delay
(
500
);
digitalWrite
(
ledPin
,
LOW
);
aux
=
0
;
}
else
{
// turn LED off:
digitalWrite
(
ledPin
,
LOW
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment