Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BitS2 bare Minimum
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ibrahim Mohammad
BitS2 bare Minimum
Commits
aa29076e
Commit
aa29076e
authored
1 year ago
by
Julia Magdalena Brandt
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
73ab1a94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bits-bare-minimum-zyklus-1.ino
+112
-0
112 additions, 0 deletions
bits-bare-minimum-zyklus-1.ino
with
112 additions
and
0 deletions
bits-bare-minimum-zyklus-1.ino
0 → 100644
+
112
−
0
View file @
aa29076e
/***************************************************
________ ___ _________ ________ _______
|\ __ \|\ \|\___ ___\\ ____\ / ___ \
\ \ \|\ /\ \ \|___ \ \_\ \ \___|_/__/|_/ /|
\ \ __ \ \ \ \ \ \ \ \_____ \__|// / /
\ \ \|\ \ \ \ \ \ \ \|____|\ \ / /_/__
\ \_______\ \__\ \ \__\ ____\_\ \|\________\
\|_______|\|__| \|__| |\_________\\|_______|
\|_________|
Name:
<Hier kommt der Name des Projekts>
Description:
<Hier kommt was dieses Skript macht>
Author:
<Hier kommt dein Name>
**************************************************/
#define DEBUG_SERIAL
// #define WIFI_COMMUNICATION
#ifdef DEBUG_SERIAL
#define _println_(x) Serial.println(x)
#define _print_(x) Serial.print(x)
#else
#ifdef WIFI_COMMUNICATION
#define _println_(x) Serial3.println(x)
#define _print_(x) Serial3.print(x)
#else
#define _println_(x)
#define _print_(x)
#endif
#endif
#include
"config.h"
#include
"basic_functions.h"
#include
"custom_config.h"
#include
"custom_functions.h"
void
setup
(){
// Hier wird entschieden wie die Serielle Kommunikation vom Mega erfolgen soll. Weiteres siehe in config.h
#ifdef DEBUG_SERIAL
Serial
.
begin
(
115200
);
#endif
#ifdef WIFI_COMMUNICATION
Serial3
.
begin
(
115200
);
#endif
// Initialisierung der optischen Time-of-Flight Sensoren
tof_controller
.
init
();
// Starten der I2C Kommunikation
Wire
.
begin
();
Wire
.
setClock
(
400000
);
// 400kHz I2C clock. Comment this line if having compilation difficulties
// Initialisierung der LED-Streifen
front_strip
.
init
();
back_strip
.
init
();
left_strip
.
init
();
right_strip
.
init
();
// Initialisierung der IMU inkl. Lichtspiel
imu
.
init
();
start
=
millis
();
_println_
(
"Waiting for IMU getting ready. Please do not move the car!"
);
_print_
(
"Waiting"
);
set_led_color
(
255
,
0
,
0
);
for
(
int
k
=
0
;
k
<
13
;
k
++
){
for
(
int
i
=
0
;
i
<
FRONT_LED_NUM
;
i
++
){
front_strip
.
set_pixel_color
(
i
,
thk_LedStripController
::
Color
(
red
,
green
,
blue
));
front_strip
.
show
();
delay
(
500
/
FRONT_LED_NUM
);
_print_
(
"."
);
}
for
(
int
i
=
0
;
i
<
FRONT_LED_NUM
;
i
++
){
front_strip
.
set_pixel_color
(
i
,
thk_LedStripController
::
Color
(
0
,
0
,
0
));
front_strip
.
show
();
delay
(
500
/
FRONT_LED_NUM
);
_print_
(
"."
);
}
red
-=
20
;
green
+=
20
;
}
// Pin deklaration der Ultraschallsensoren
pinMode
(
TRIGF
,
OUTPUT
);
pinMode
(
TRIGB
,
OUTPUT
);
pinMode
(
ECHOF
,
INPUT
);
pinMode
(
ECHOB
,
INPUT
);
// Initialisierung des Motors
Motor
.
init
();
// Initialisierung der Servomotoren
ServoSteer
.
begin
();
ServoSearch
.
begin
();
// Initialisierung abgeschlossen
_println_
(
"Ready!"
);
buzzer_signal
(
350
,
2
,
100
);
set_led_color
(
0
,
100
,
0
);
all_led_blink
(
2
,
200
);
}
void
loop
(){
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment