mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-05 18:14:31 +02:00
Release
This commit is contained in:
20
example/IMU/Detection_Print/Detection_Print.ino
Normal file
20
example/IMU/Detection_Print/Detection_Print.ino
Normal file
@ -0,0 +1,20 @@
|
||||
#include "Dezibot.h"
|
||||
Dezibot dezibot;
|
||||
void setup() {
|
||||
|
||||
dezibot.begin();
|
||||
dezibot.motionDetection.begin();
|
||||
//dezibot.motionDetection.end();
|
||||
// put your setup code here, to run once:
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
|
||||
//Serial.println(dezibot.motionDetection.getTemperature());
|
||||
Serial.println(dezibot.motionDetection.getAcceleration().z);
|
||||
//Serial.println(dezibot.motionDetection.getRotation().x);
|
||||
Serial.println(dezibot.motionDetection.getWhoAmI());
|
||||
delay(5000);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
#include "Dezibot.h"
|
||||
Dezibot dezibot = Dezibot();
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
dezibot.begin();
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
int indices = 0;
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
|
||||
|
||||
int zvalue = 0;
|
||||
for(int i = 0; i<30;i++){
|
||||
zvalue += dezibot.motionDetection.getAcceleration().z;
|
||||
}
|
||||
zvalue = zvalue/30;
|
||||
if(zvalue < -1700){
|
||||
dezibot.multiColorLight.setLed(ALL,0x00FF00);
|
||||
} else if(zvalue > 1700){
|
||||
dezibot.multiColorLight.setLed(ALL,0xFF0000);
|
||||
} else {
|
||||
dezibot.multiColorLight.turnOffLed();
|
||||
}
|
||||
}
|
||||
|
26
example/Led/ColorCycle/ColorCycle/ColorCycle.ino
Normal file
26
example/Led/ColorCycle/ColorCycle/ColorCycle.ino
Normal file
@ -0,0 +1,26 @@
|
||||
#include "Dezibot.h"
|
||||
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
dezibot.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
for (int d = 0; d < 255; d++) {
|
||||
dezibot.multiColorLight.setLed(ALL,dezibot.multiColorLight.color(d,0,255-d));
|
||||
delay(2);
|
||||
}
|
||||
|
||||
for (int d = 0; d < 255; d++) {
|
||||
dezibot.multiColorLight.setLed(ALL, dezibot.multiColorLight.color(255-d, d, 0));
|
||||
delay(2);
|
||||
}
|
||||
|
||||
for (int d = 0; d < 255; d++) {
|
||||
dezibot.multiColorLight.setLed(ALL, dezibot.multiColorLight.color(0, 255-d, d));
|
||||
delay(2);
|
||||
}
|
||||
}
|
21
example/lightdetection_serial/lightdetection_serial.ino
Normal file
21
example/lightdetection_serial/lightdetection_serial.ino
Normal file
@ -0,0 +1,21 @@
|
||||
/****************************************************
|
||||
* If you have selected ESP32-S3-USB_OTG as the board,
|
||||
* change Tools->USB_Mode to "Hardware CDC and JTAG".
|
||||
*****************************************************/
|
||||
|
||||
#include <Dezibot.h>
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println("Started");
|
||||
dezibot.begin();
|
||||
Serial.println("Inited");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Serial.println(dezibot.lightDetection.getValue(DL_FRONT));
|
||||
delay(1000);
|
||||
}
|
||||
|
18
example/motion_indicating/motion_indicating.ino
Normal file
18
example/motion_indicating/motion_indicating.ino
Normal file
@ -0,0 +1,18 @@
|
||||
#include <Dezibot.h>
|
||||
Dezibot dezibot = Dezibot();
|
||||
void setup() {
|
||||
dezibot.begin();
|
||||
}
|
||||
void loop() {
|
||||
dezibot.motion.move(1000);
|
||||
dezibot.multiColorLight.setLed(BOTTOM, RED);
|
||||
delay(2000);
|
||||
dezibot.motion.rotateAntiClockwise(1000);
|
||||
dezibot.multiColorLight.setLed(BOTTOM, GREEN);
|
||||
delay(2000);
|
||||
dezibot.motion.rotateClockwise(1000);
|
||||
dezibot.multiColorLight.setLed(BOTTOM, BLUE);
|
||||
delay(2000);
|
||||
dezibot.multiColorLight.turnOffLed();
|
||||
delay(2000);
|
||||
}
|
18
example/motion_minimum/motion_minimum.ino
Normal file
18
example/motion_minimum/motion_minimum.ino
Normal file
@ -0,0 +1,18 @@
|
||||
#include <Dezibot.h>
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
void setup() {
|
||||
dezibot.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
dezibot.motion.move();
|
||||
delay(1000);
|
||||
dezibot.motion.rotateAntiClockwise();
|
||||
delay(1000);
|
||||
dezibot.motion.rotateClockwise();
|
||||
delay(1000);
|
||||
dezibot.motion.stop();
|
||||
delay(1000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user