smalrubot 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smalrubot/board/studuino.rb +3 -0
- data/lib/smalrubot/board.rb +2 -0
- data/lib/smalrubot/version.rb +1 -1
- data/sketch/lib/SrStuduino.cpp +16 -0
- data/sketch/lib/SrStuduino.h +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c63e5012fe6bf9c4af243c931bb79ba528373ce3
|
4
|
+
data.tar.gz: 6d970abfe7aff0ef9c68fb88d4a4d01940082808
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ec9477102a417ad4576aa8de20d7664fedb50151aae54abc3737e6d7f599d09a64f7c574a6828192c0f871ded0a717ec440244a056bf79973accb7a08dbad2
|
7
|
+
data.tar.gz: cf1e077c3a277155fc418588dd0abdd7d0c4e29f1b51a5e30116f7012e1c71a989bf133866b571bee073dde567bc0ef30ab8cba0ed06fbbb196592c444a5e08f
|
data/lib/smalrubot/board.rb
CHANGED
data/lib/smalrubot/version.rb
CHANGED
data/sketch/lib/SrStuduino.cpp
CHANGED
@@ -28,6 +28,9 @@ void SrStuduino::processCommand() {
|
|
28
28
|
case 43:
|
29
29
|
dcMotorControl();
|
30
30
|
break;
|
31
|
+
case 51:
|
32
|
+
led();
|
33
|
+
break;
|
31
34
|
|
32
35
|
case 61:
|
33
36
|
getTouchSensorValue();
|
@@ -136,6 +139,19 @@ void SrStuduino::dcMotorControl() {
|
|
136
139
|
studuino.DCMotorControl(motorPorts[pin], rotations[val]);
|
137
140
|
}
|
138
141
|
|
142
|
+
/**
|
143
|
+
* !51<sensor_index><onoff>.
|
144
|
+
*
|
145
|
+
* sensor_index(2): 0-7 => PORT_A0-PORT_A7
|
146
|
+
* onoff(3): 0 => OFF or
|
147
|
+
* 1 => ON
|
148
|
+
**/
|
149
|
+
void SrStuduino::led() {
|
150
|
+
boolean onoff[] = { OFF, ON };
|
151
|
+
|
152
|
+
studuino.LED(analogPorts[pin], onoff[val]);
|
153
|
+
}
|
154
|
+
|
139
155
|
/**
|
140
156
|
* !61<sensor_index>.
|
141
157
|
*
|
data/sketch/lib/SrStuduino.h
CHANGED
@@ -20,8 +20,11 @@ class SrStuduino : public Smalrubot {
|
|
20
20
|
void setDcMotorCalibration();
|
21
21
|
void initDcMotorPort();
|
22
22
|
void initSensorPort();
|
23
|
+
|
23
24
|
void dcMotorPower();
|
24
25
|
void dcMotorControl();
|
26
|
+
void led();
|
27
|
+
|
25
28
|
void getTouchSensorValue();
|
26
29
|
void getLightSensorValue();
|
27
30
|
void getIrPhotoreflectorValue();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smalrubot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouji Takao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyserial
|