Skip to content

Commit 73f8bc2

Browse files
committed
add car's event
1 parent e548171 commit 73f8bc2

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

webduino-blockly.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,36 @@
335335
self._lf.write(0);
336336
self._lb.write(0);
337337
};
338+
toyCar.prototype.onlyLeftFront = function () {
339+
var self = this;
340+
self._rf.write(1);
341+
self._rb.write(0);
342+
};
343+
toyCar.prototype.onlyRightFront = function () {
344+
var self = this;
345+
self._lf.write(1);
346+
self._lb.write(0);
347+
};
348+
toyCar.prototype.onlyLeftBack = function () {
349+
var self = this;
350+
self._rf.write(1);
351+
self._rb.write(0);
352+
};
353+
toyCar.prototype.onlyRightBack = function () {
354+
var self = this;
355+
self._lf.write(1);
356+
self._lb.write(0);
357+
};
358+
toyCar.prototype.onlyLeftStop = function () {
359+
var self = this;
360+
self._rf.write(0);
361+
self._rb.write(0);
362+
};
363+
toyCar.prototype.onlyRightStop = function () {
364+
var self = this;
365+
self._lf.write(0);
366+
self._lb.write(0);
367+
};
338368

339369
function getToyCar(board, RF, RB, LF, LB) {
340370
return new toyCar(board, RF, RB, LF, LB);

0 commit comments

Comments
 (0)