Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LED_Matrix_Game
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bs_uc
ss21
LED_Matrix_Game
Commits
8b164d1a
Commit
8b164d1a
authored
4 years ago
by
Annika
Browse files
Options
Downloads
Patches
Plain Diff
Display -> Uart
parent
7ff9b907
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/Src/main.c
+19
-15
19 additions, 15 deletions
Core/Src/main.c
with
19 additions
and
15 deletions
Core/Src/main.c
+
19
−
15
View file @
8b164d1a
...
@@ -1012,26 +1012,30 @@ void Validate(void *argument)
...
@@ -1012,26 +1012,30 @@ void Validate(void *argument)
void
Display
(
void
*
argument
)
void
Display
(
void
*
argument
)
{
{
/* USER CODE BEGIN Display */
/* USER CODE BEGIN Display */
int
rec
=
1
;
// Initialisierung mit 1 damit am Anfang nicht die Todesnachricht ausgegeben wird
uint8_t
points
=
0
;
uint8_t
CarRet
[]
=
{
"
\n
"
};
/* Infinite loop */
/* Infinite loop */
for
(;;)
for
(;;)
{
{
int
rec
=
1
;
// Initialisierung mit 1 damit am Anfang nicht die Todesnachricht ausgegeben wird
int
points
=
0
;
char
punkte
[]
=
"1000"
;
if
(
xQueueReceive
(
toDisplayQueueHandle
,
&
rec
,
(
portTickType
)
0
)
==
true
)
if
(
xQueueReceive
(
toDisplayQueueHandle
,
&
rec
,
(
portTickType
)
0
)
==
true
)
{
{
points
+=
rec
;
points
+=
rec
;
punkte
[
0
]
=
points
/
100
;
HAL_UART_Init
(
&
huart3
);
punkte
[
1
]
=
(
points
%
100
)
/
10
;
HAL_UART_Transmit
(
&
huart3
,
&
points
,
3
,
1000
);
punkte
[
2
]
=
points
%
10
;
HAL_UART_Transmit
(
&
huart3
,
CarRet
,
sizeof
(
CarRet
),
1000
);
}
// LCD_init();
// LCD_setCursor(0,0);
// LCD_print(punkte);
if
(
rec
==
0
)
if
(
rec
==
0
)
{
{
// LCD_print("You are dead");
uint8_t
DeadMessage
[]
=
{
"You are Dead, you reached "
};
uint8_t
PointsMessage
[]
=
{
" points"
};
HAL_UART_Init
(
&
huart3
);
HAL_UART_Transmit
(
&
huart3
,
DeadMessage
,
sizeof
(
DeadMessage
),
1000
);
HAL_UART_Transmit
(
&
huart3
,
&
points
,
3
,
1000
);
HAL_UART_Transmit
(
&
huart3
,
PointsMessage
,
sizeof
(
DeadMessage
),
1000
);
HAL_UART_Transmit
(
&
huart3
,
CarRet
,
sizeof
(
CarRet
),
1000
);
}
}
}
}
}
/* USER CODE END Display */
/* USER CODE END Display */
...
...
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