Skip to content

This repo is for the Software training of COMP3414 2020.

License

Notifications You must be signed in to change notification settings

HKURoboMaster/Breathing-Light

Repository files navigation

Assignment 6 for Automation

Breathing light

What you are asked to make is a breathing light. image

You should implement the tasks below one by one, and submit the change that achieve the most functions! (Only fulfill the first task is good enough)

  1. Use a switch(output 0 when closed, 1 when open!!!!!) to control the on/off of the light

    (About where you can find the labels:

    • The two pdf files and also the developing board itself.

      You should find the label of the switch and the LED yourself. If you cannot find them, you can ask me for help. Apologies that some materials are not in Chinese.)

  2. Make the light that will be connected to PB11 to breath periodically

    (The mechanism of breathing light is change the pulse of PWM periodically.)

  3. Make the period to be 2s (1s to brighten and 1s to darken)

How to hand in your assignment?

  • 1. Please create a branch under this repository named after you storing your project code.

  • 2. Please take a short video of you demonstrating the function of your model. Upload you video here. The video should also name after you.

Some hints to help you:

  1. use HAL_Delay(time) to keep the existing state of the developing board for timeμs
  2. HAL_TIM_PWM_Start(&htim8, TIM_CHANNEL_4);
  3. Do not mistake the concept of period of breathing light and period of PWM.
  4. Use HAL_GPIO_ReadPin(GPIO_port, GPIO_PIN_id) to read the pin.
  5. There is no need to create any interrupt, just add your code in the while loop inside main()
  6. All the techniques you need is taught in the training, so those who didn't come please refer to the slide and video.
  7. You will never know what problems you will encounter if you don't practice those theories by yourself!
  8. Ask google or me if there's any uncertainty, my email's [email protected]

About

This repo is for the Software training of COMP3414 2020.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published