2020-04-02 01:49 AM - edited 2023-11-20 09:27 AM
The question including in the 1st picture i want to ask that is that any material allow me to learn for coding and solve assignment question.2nd picture whole part of board
3rd picture is STM32F407
4th picture is the part of the joystick
This is my currency code :
#include "***-02.h"
uint8_t
GetJoystick ()
{
// REPLACE THE FOLLOW CODE WITH YOUR SOLUTION
// This code just to generate some input from the joystick
static uint8_t PreviousJoystick='L';
uint8_t Joystick;
Joystick = ReadJoystick ();
if (Joystick != 0)
{
PreviousJoystick = Joystick;
}
HAL_Delay(1000);
return PreviousJoystick;
}
void
StateMachine ()
{
// REPLACE THE FOLLOW CODE WITH YOUR SOLUTION
// This code just toggles top LED and set left or right LED.
//
// Solution.
uint8_t Joystick;
uint8_t Toggle = 0;
while (1)
{
Joystick = GetJoystick();
if (Joystick == 'L')
{
WriteLED ('L', LED_ON);
WriteLED ('R', LED_OFF);
}
else if (Joystick == 'R')
{
WriteLED ('L', LED_OFF);
WriteLED ('R', LED_ON);
}
if (Toggle == 0)
{
WriteLED ('T', LED_ON);
Toggle = 1;
}
else
{
WriteLED ('T', LED_OFF);
Toggle = 0;
}
}
}
Thanks for any help in advance!!!
2020-04-02 07:27 PM
Hi clive, u are miss understanding me i not request u to help me do the assignment. I will do every thing by myself i just need some reference from some book or some forum.
I trying to read the K&R C manual that u suggested.
Thanks for taking time to reply me.