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
scripts-perso
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
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Daniel Stan
scripts-perso
Commits
92c94d38
Commit
92c94d38
authored
Jan 09, 2017
by
Daniel STAN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lotus !
parent
3f311d97
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
0 deletions
+101
-0
arduino/lotus/lotus.ino
arduino/lotus/lotus.ino
+101
-0
arduino/lotus/parts
arduino/lotus/parts
+0
-0
arduino/lotus/schema.fzz
arduino/lotus/schema.fzz
+0
-0
No files found.
arduino/lotus/lotus.ino
0 → 100644
View file @
92c94d38
/* Arduino directement connecté à kugel, pour communiquer
avec programme python coté port série*/
// Pin du recepteur Infrarouge
#define RECV_PIN 13
// Pin du moteur
#define RF_M_CONT 10
#define RF_M_DRV1 11
#define RF_M_DRV2 12
#include <IRLib.h>
IRrecv
My_Receiver
(
RECV_PIN
);
// For ir-decoder
IRdecodeNEC
My_Decoder
;
unsigned
int
Buffer
[
RAWBUF
];
void
setup
()
{
Serial
.
begin
(
9600
);
delay
(
2000
);
while
(
!
Serial
);
//delay for Leonardo
My_Receiver
.
enableIRIn
();
// Start the receiver
My_Decoder
.
UseExtnBuf
(
Buffer
);
pinMode
(
RF_M_CONT
,
OUTPUT
);
pinMode
(
RF_M_DRV1
,
OUTPUT
);
pinMode
(
RF_M_DRV2
,
OUTPUT
);
digitalWrite
(
RF_M_CONT
,
HIGH
);
digitalWrite
(
RF_M_DRV1
,
LOW
);
digitalWrite
(
RF_M_DRV2
,
HIGH
);
}
void
loop
()
{
int
val
;
int
incomingByte
=
0
;
delay
(
1000
);
digitalWrite
(
RF_M_DRV1
,
LOW
);
digitalWrite
(
RF_M_DRV2
,
HIGH
);
delay
(
1000
);
digitalWrite
(
RF_M_DRV2
,
LOW
);
digitalWrite
(
RF_M_DRV1
,
HIGH
);
if
(
My_Receiver
.
GetResults
(
&
My_Decoder
))
{
//Restart the receiver so it can be capturing another code
//while we are working on decoding this one.
My_Receiver
.
resume
();
if
(
My_Decoder
.
decode
()
)
switch
(
My_Decoder
.
value
)
{
case
0xFD807F
:
Serial
.
println
(
"Control: PPause"
);
break
;
case
0xFD00FF
:
Serial
.
println
(
"Control: Vol-"
);
break
;
case
0xFD40BF
:
Serial
.
println
(
"Control: Vol+"
);
break
;
case
0xFD08F7
:
Serial
.
println
(
"Control: 1"
);
break
;
case
0xFD8877
:
Serial
.
println
(
"Control: 2"
);
break
;
case
0xFD48B7
:
Serial
.
println
(
"Control: 3"
);
break
;
case
0xFD28D7
:
Serial
.
println
(
"Control: 4"
);
break
;
case
0xfd10ef
:
Serial
.
println
(
"Control: Prev"
);
break
;
case
0xfd50af
:
Serial
.
println
(
"Control: Next"
);
break
;
case
0xfd20df
:
Serial
.
println
(
"Control: Setup"
);
break
;
case
0xfd609f
:
Serial
.
println
(
"Control: Stop"
);
break
;
case
0xfd906f
:
Serial
.
println
(
"Control: Enter"
);
break
;
case
0xfd708f
:
Serial
.
println
(
"Control: Return"
);
break
;
default:
Serial
.
print
(
"Unkwon: "
);
Serial
.
println
(
My_Decoder
.
value
);
}
//My_Decoder.DumpResults();
}
}
arduino/
d
s/parts
→
arduino/
lotu
s/parts
View file @
92c94d38
File moved
arduino/
d
s/schema.fzz
→
arduino/
lotu
s/schema.fzz
View file @
92c94d38
File moved
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