mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 02:01:42 +02:00
added example sketches
This commit is contained in:
23
example/advanced/phototaxis/phototaxis.ino
Normal file
23
example/advanced/phototaxis/phototaxis.ino
Normal file
@ -0,0 +1,23 @@
|
||||
#include "Dezibot.h"
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
dezibot.begin();
|
||||
dezibot.multiColorLight.turnOffLed();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
dezibot.display.clear();
|
||||
int light = dezibot.lightDetection.getValue(DL_FRONT);
|
||||
dezibot.display.print(light);
|
||||
|
||||
if(light > 2000) {
|
||||
dezibot.motion.move();
|
||||
} else {
|
||||
dezibot.motion.rotateClockwise();
|
||||
}
|
||||
delay(100);
|
||||
|
||||
}
|
Reference in New Issue
Block a user