ok
This commit is contained in:
parent
c968a22a26
commit
2751c43a52
Binary file not shown.
Before Width: | Height: | Size: 3.3 MiB |
28
README.md
Normal file
28
README.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Arduino analog Joystick
|
||||
|
||||
Arduino's code is something like:
|
||||
```c
|
||||
int joystickPin = A0;
|
||||
int getPushedButton(int joystickPin){
|
||||
int val=analogRead(joystickPin);
|
||||
if(val > 1000){
|
||||
return 0;
|
||||
}else if (val > 650){
|
||||
return 4;
|
||||
}else if(val > 450){
|
||||
return 6;
|
||||
}else if(val > 120){
|
||||
return 5;
|
||||
}else if(val > 45){
|
||||
return 3;
|
||||
}else if(val > 15){
|
||||
return 1;
|
||||
}else{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Adapt limit values if you use differents resistors than mines.
|
||||
|
||||
|
|
@ -7,6 +7,7 @@ difference(){
|
|||
linear_extrude (height=2)
|
||||
import (file="profils.dxf", layer="tranche", $fn=200);
|
||||
}
|
||||
|
||||
translate([0,0,5])
|
||||
linear_extrude (height=6)
|
||||
import (file="profils.dxf", layer="holes-for-buttons", $fn=200);
|
||||
|
|
43836
box/box.stl
43836
box/box.stl
File diff suppressed because it is too large
Load Diff
718
box/profils.dxf
718
box/profils.dxf
File diff suppressed because it is too large
Load Diff
|
@ -1,34 +0,0 @@
|
|||
# Pin name action command file
|
||||
|
||||
# Start of element A0
|
||||
ChangePinName(A0, 1, 1)
|
||||
|
||||
# Start of element S?
|
||||
ChangePinName(S?, 2, 2)
|
||||
ChangePinName(S?, 1, 1)
|
||||
ChangePinName(S?, 2, 2)
|
||||
ChangePinName(S?, 1, 1)
|
||||
ChangePinName(S?, 2, 2)
|
||||
ChangePinName(S?, 1, 1)
|
||||
ChangePinName(S?, 2, 2)
|
||||
ChangePinName(S?, 1, 1)
|
||||
ChangePinName(S?, 2, 2)
|
||||
ChangePinName(S?, 1, 1)
|
||||
ChangePinName(S?, 2, 2)
|
||||
ChangePinName(S?, 1, 1)
|
||||
|
||||
# Start of element R?
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
||||
ChangePinName(R?, 1, 1)
|
||||
ChangePinName(R?, 2, 2)
|
|
@ -1,9 +0,0 @@
|
|||
unnamed_net7 A0-1 S?-2 R?-1
|
||||
GND R?-2
|
||||
unnamed_net6 S?-1 R?-2
|
||||
unnamed_net5 S?-1 R?-2
|
||||
unnamed_net4 S?-1 R?-2
|
||||
unnamed_net3 S?-1 R?-2
|
||||
unnamed_net2 S?-1 R?-2
|
||||
+5V R?-1
|
||||
unnamed_net1 S?-1 R?-2
|
BIN
electronics/schema.png
Normal file
BIN
electronics/schema.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 43 KiB |
|
@ -1,154 +0,0 @@
|
|||
v 20130925 2
|
||||
C 40000 40000 0 0 0 title-B.sym
|
||||
C 43600 49100 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 43900 49500 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 43800 49400 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 43600 49100 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 43600 48300 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 43900 48700 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 43800 48600 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 43600 48300 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 43600 47700 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 43900 48100 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 43800 48000 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 43600 47700 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 43600 47100 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 43900 47500 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 43800 47400 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 43600 47100 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 43600 46400 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 43900 46800 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 43800 46700 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 43600 46400 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 43600 45600 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 43900 46000 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 43800 45900 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 43600 45600 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 49300 47500 1 0 0 resistor-1.sym
|
||||
{
|
||||
T 49600 47900 5 10 0 0 0 0 1
|
||||
device=RESISTOR
|
||||
T 49500 47800 5 10 1 1 0 0 1
|
||||
refdes=R?
|
||||
T 49300 47500 5 10 1 1 0 0 1
|
||||
footprint=RES-1016P-630L-240D__Yageo-MFR-25.fp
|
||||
}
|
||||
C 44600 49100 1 0 0 switch-pushbutton-nc-1.sym
|
||||
{
|
||||
T 44150 48900 5 10 0 0 0 0 1
|
||||
device=SWITCH_PUSHBUTTON_NC
|
||||
T 45000 49450 5 10 1 1 0 0 1
|
||||
refdes=S?
|
||||
T 44600 49100 5 10 1 1 0 0 1
|
||||
footprint=SW__Panasonic_EVQQ2_Series
|
||||
}
|
||||
C 44600 48300 1 0 0 switch-pushbutton-nc-1.sym
|
||||
{
|
||||
T 44150 48100 5 10 0 0 0 0 1
|
||||
device=SWITCH_PUSHBUTTON_NC
|
||||
T 45000 48650 5 10 1 1 0 0 1
|
||||
refdes=S?
|
||||
T 44600 48300 5 10 1 1 0 0 1
|
||||
footprint=SW__Panasonic_EVQQ2_Series
|
||||
}
|
||||
C 44600 47700 1 0 0 switch-pushbutton-nc-1.sym
|
||||
{
|
||||
T 44150 47500 5 10 0 0 0 0 1
|
||||
device=SWITCH_PUSHBUTTON_NC
|
||||
T 45000 48050 5 10 1 1 0 0 1
|
||||
refdes=S?
|
||||
T 44600 47700 5 10 1 1 0 0 1
|
||||
footprint=SW__Panasonic_EVQQ2_Series
|
||||
}
|
||||
C 44600 47100 1 0 0 switch-pushbutton-nc-1.sym
|
||||
{
|
||||
T 44150 46900 5 10 0 0 0 0 1
|
||||
device=SWITCH_PUSHBUTTON_NC
|
||||
T 45000 47450 5 10 1 1 0 0 1
|
||||
refdes=S?
|
||||
T 44600 47100 5 10 1 1 0 0 1
|
||||
footprint=SW__Panasonic_EVQQ2_Series
|
||||
}
|
||||
C 44600 46400 1 0 0 switch-pushbutton-nc-1.sym
|
||||
{
|
||||
T 44150 46200 5 10 0 0 0 0 1
|
||||
device=SWITCH_PUSHBUTTON_NC
|
||||
T 45000 46750 5 10 1 1 0 0 1
|
||||
refdes=S?
|
||||
T 44600 46400 5 10 1 1 0 0 1
|
||||
footprint=SW__Panasonic_EVQQ2_Series
|
||||
}
|
||||
C 44600 45600 1 0 0 switch-pushbutton-nc-1.sym
|
||||
{
|
||||
T 44150 45400 5 10 0 0 0 0 1
|
||||
device=SWITCH_PUSHBUTTON_NC
|
||||
T 45000 45950 5 10 1 1 0 0 1
|
||||
refdes=S?
|
||||
T 44600 45600 5 10 1 1 0 0 1
|
||||
footprint=SW__Panasonic_EVQQ2_Series
|
||||
}
|
||||
C 41200 47500 1 0 0 5V-plus-1.sym
|
||||
N 43600 47500 43600 47800 4
|
||||
N 41400 47500 43600 47500 4
|
||||
N 43600 49200 43100 49200 4
|
||||
N 43100 49200 43100 47500 4
|
||||
N 43600 48400 43100 48400 4
|
||||
N 43100 45700 43100 47500 4
|
||||
N 43100 47200 43600 47200 4
|
||||
N 43600 46500 43100 46500 4
|
||||
N 43600 45700 43100 45700 4
|
||||
N 44600 48400 44500 48400 4
|
||||
N 44600 47800 44500 47800 4
|
||||
N 44600 47200 44500 47200 4
|
||||
N 44600 46500 44500 46500 4
|
||||
N 44600 45700 44500 45700 4
|
||||
N 44500 49200 44600 49200 4
|
||||
N 45600 49200 48800 49200 4
|
||||
N 48800 45700 48800 49200 4
|
||||
N 45600 48400 48800 48400 4
|
||||
N 45600 47800 48800 47800 4
|
||||
N 45600 47200 48800 47200 4
|
||||
N 45600 46500 48800 46500 4
|
||||
N 45600 45700 48800 45700 4
|
||||
N 48800 47600 49300 47600 4
|
||||
N 49300 47600 49300 45300 4
|
||||
C 49300 45200 1 0 0 out-1.sym
|
||||
{
|
||||
T 49300 45500 5 10 0 0 0 0 1
|
||||
device=OUTPUT
|
||||
T 49300 45500 5 10 1 1 0 0 1
|
||||
refdes=A0
|
||||
T 49300 45200 5 10 1 1 0 0 1
|
||||
footprint=hard-hex-standoff-2
|
||||
}
|
||||
C 50100 47300 1 0 0 gnd-1.sym
|
10
electronics/valeurs.txt
Normal file
10
electronics/valeurs.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
bouton | analogread
|
||||
|
||||
aucun | 1023
|
||||
haut | 20
|
||||
bas | 9
|
||||
gauche | 60
|
||||
droite | 705
|
||||
|
||||
haut 2 | 183
|
||||
bas2 | 510
|
Loading…
Reference in New Issue
Block a user