Skip to content

Commit 516d39e

Browse files
committed
update simulator programming for the new API
1 parent c9d6efb commit 516d39e

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

simulator/simulator_programming.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,46 +78,48 @@ Setting each servo to -1 fully opens the respective jaw.
7878

7979
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`.
8080

81-
### Ruggeduino
81+
### Arduino
8282

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.
8484

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.
8686

8787
#### Microswitches
8888

89+
The rear of the robot has a wide microswitch.
90+
8991
The microswitch is attached to digital pin 2:
9092

91-
| Pin | Location |
92-
|-----|----------|
93-
| 2 | Back |
93+
| Pin | Location | Required Mode |
94+
|-----|----------|---------------|
95+
| 2 | Back | `INPUT` |
9496

9597
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.
9698

9799
#### Distance Sensors
98100

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:
100102

101-
| Pin | Location |
102-
|-----|----------|
103-
| A0 | Front Left |
103+
| Pin | Location |
104+
|-----|-------------|
105+
| A0 | Front Left |
104106
| 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 |
109111

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.
111113
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.
112114

113115
#### LEDs
114116

115117
The LEDs are attached to digital pins 3-4:
116118

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` |
121123

122124
Using the `digital_write` method, you can set these to True (On) or False (Off).
123125

@@ -142,7 +144,7 @@ The servos to move the fingers are attached to servo pins 2 and 3 in the servo b
142144
| 2 | Left finger servo |
143145
| 3 | Right finger servo |
144146

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.
146148

147149
| Pin | Location |
148150
|-----|------------------------------|

0 commit comments

Comments
 (0)