EasyManua.ls Logo

pitsco TETRIX PULSE

pitsco TETRIX PULSE
146 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Block-Text Correlation
void setup() {
pulse.PulseBegin();
pulse.setMotorInvert(1,1);
if (pulse.readLineSensor(2) == 0) {
pulse.setMotorPowers(35,35);
if (pulse.readLineSensor(2) == 1) {
pulse.setMotorPowers(0,0);
while (pulse.readLineSensor(2) == 1) {
pulse.setRedLED(HIGH);
delay(500);
pulse.setRedLED(LOW);
delay(500);
Note: This if()
loop runs the
motors if the
reading is 0.
Note: This if()
loop stops the
motors if the
reading is 1.
Note: This while() loop
blinks the LED off and on
while the reading is 1.
Arduino Source Code
#include <PULSE.h>
PULSE pulse;
void setup() {
pulse.PulseBegin();
pulse.setMotorInvert(1,1);
}
void loop() {
if (pulse.readLineSensor(2) == 0) {
pulse.setMotorPowers(35,35);
}
if (pulse.readLineSensor(2) == 1) {
pulse.setMotorPowers(0,0);
while (pulse.readLineSensor(2) == 1) {
pulse.setRedLED(HIGH);
delay(500);
pulse.setRedLED(LOW);
delay(500);
}
}
}
Building and Coding the PULSE CodeeBot 107

Related product manuals