Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you write a C program in Keil Vision so that when you press and hold the B1 push button, it lights the LD2 LED

Could you write a C program in Keil Vision so that when you press and hold the B1 push button, it lights the LD2 LED on the Nucleo STM32103RB. Below is the program skeleton and .h file needed.image text in transcribed

//util.h

#include

void delay(uint32_t delay); void clockInit(void); void led_IO_init (void); void sw2led(void);

//Bit masks for leds on STM32VLDiscovery board PC8 and PC9 using GPIOC_BSRR // Green LED is on bit 9 of port C, Blue LED is on bit 8. // #define VL_GREEN_ON 0X00000200 // #define VL_GREEN_OFF 0x02000000 // #define VL_BLUE_ON 0x00000100 // #define VL_BLUE_OFF 0x01000000

//Bit masks for led on NUCLEO-6 board PA5 GPIOA_BSRR // Green LED is on bit 5 of port A #define NUC_GREEN_ON 0X00000020 #define NUC_GREEN_OFF 0x00200000

* FILENAME: something.c # * DESCRIPTION: State the purpose of this program A comment block # * AUTHOR: (your name, your co-developers names, your SID) #include "util.h" ------- Include files int main(void) { //Functions to execute once InitializeSomethingHere(); InitializeAnother Thing(; |------ main() function //Functions to execute continuously while (1) + Infinite Loop { Really_important_stuff(): } } return_type name (calling_arg_type calling_arg_val) { Magical/Arcane Statements user functions not in library file }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions