You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: simulator/simulator_programming.md
+22-20Lines changed: 22 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,46 +78,48 @@ Setting each servo to -1 fully opens the respective jaw.
78
78
79
79
The servo board has the part code `srXYZ2`, but since only a single servo board is attached it can be referenced as `R.servo_board`.
80
80
81
-
### Ruggeduino
81
+
### Arduino
82
82
83
-
Your robot has a microswitch and six distance sensors, attached to the digital and analogue pins respectively. These are all attached to a single ruggeduino.
83
+
Your robot has a microswitch and six distance sensors, attached to the digital and analog pins respectively. These are all attached to a single arduino.
84
84
85
-
Because these sensors are pre-attached to the ruggeduino, you do not need to set its `pin_mode`.
85
+
Make sure you have set the correct [pin_mode]({{ site.baseurl }}/programming/arduino/sr_firmware#setting-pin-modes), depending on what device you're using.
86
86
87
87
#### Microswitches
88
88
89
+
The rear of the robot has a wide microswitch.
90
+
89
91
The microswitch is attached to digital pin 2:
90
92
91
-
| Pin | Location |
92
-
|-----|----------|
93
-
| 2 | Back |
93
+
| Pin | Location | Required Mode |
94
+
|-----|----------|---------------|
95
+
| 2 | Back |`INPUT`|
94
96
95
97
This is shown as a red coloured block on the robot. Using the `digital_read` method, you'll receive a `bool` telling you whether the switch is currently actuated.
96
98
97
99
#### Distance Sensors
98
100
99
-
Analogous to ultrasound sensors, distance sensors allow you to retrieve the distance between your robot and an object. These are attached to analogue pins A0-A5:
101
+
Analogous to ultrasound sensors, distance sensors allow you to retrieve the distance between your robot and an object. These are attached to analog pins A0-A5:
100
102
101
-
| Pin | Location |
102
-
|-----|----------|
103
-
| A0 | Front Left |
103
+
| Pin | Location |
104
+
|-----|-------------|
105
+
| A0 | Front Left |
104
106
| A1 | Front Right |
105
-
| A2 | Left |
106
-
| A3 | Right |
107
-
| A4 | Front |
108
-
| A5 | Back |
107
+
| A2 | Left |
108
+
| A3 | Right |
109
+
| A4 | Front |
110
+
| A5 | Back |
109
111
110
-
These are shown as blue boards with silver transceivers on the robot. The `analogue_read` method will return the distance in metres. They can see in a narrow cone up to a maximum of about 2m away.
112
+
These are shown as blue boards with silver transceivers on the robot. The `analog_read` method will return the distance in metres. They can see in a narrow cone up to a maximum of about 2m away.
111
113
Since these sensors rely on echoes being reflected back from objects, if the angle of incidence between the sensor's pulse and the contacted surface exceeds 22.5 degrees then the sensor will be unable to detect the object.
112
114
113
115
#### LEDs
114
116
115
117
The LEDs are attached to digital pins 3-4:
116
118
117
-
| Pin | Location |
118
-
|-----|----------|
119
-
| 3 | Red (Left)|
120
-
| 4 | Green (right) |
119
+
| Pin | Location | Required Mode |
120
+
|-----|---------------|---------------|
121
+
| 3 | Red (left) |`OUTPUT`|
122
+
| 4 | Green (right) |`OUTPUT`|
121
123
122
124
Using the `digital_write` method, you can set these to True (On) or False (Off).
123
125
@@ -142,7 +144,7 @@ The servos to move the fingers are attached to servo pins 2 and 3 in the servo b
142
144
| 2 | Left finger servo |
143
145
| 3 | Right finger servo |
144
146
145
-
Once the fingers are deployed, your robot will have reduced manoeuvrability, but you will be able to sense the total pressure on the front of the robot. The pressure measuring devices on the end of the fingers are available as analogue inputs on A6 and A7. They are meant to emulate sensors that output a value proportional to pressure, the higher the pressure the higher the voltage reading.
147
+
Once the fingers are deployed, your robot will have reduced manoeuvrability, but you will be able to sense the total pressure on the front of the robot. The pressure measuring devices on the end of the fingers are available as analog inputs on A6 and A7. They are meant to emulate sensors that output a value proportional to pressure, the higher the pressure the higher the voltage reading.
0 commit comments