Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you fix this code? if (adc

Can you fix this code?
if (adc<512) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, 0);}} if (512<=adc&adc<512*2) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, 0);}} if (512*2<=adc&adc<512*3) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, 0);}} if (512*3<=adc&adc<512*4) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, 0);}} if (512*4<=adc&adc<512*5) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_4, 0);}} if (512*5<=adc&adc<512*6) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_5, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_5, 0);}} if (512*6<=adc&adc<512*7) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_6, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_6, 0);}} if (512*7<=adc&adc<512*8) {HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, 1);} else {{HAL_GPIO_WritePin(GPIOC, GPIO_PIN_7, 0);} 

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

Step: 3

blur-text-image

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

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

ISBN: 3642341780, 978-3642341786

More Books

Students also viewed these Databases questions

Question

What is conversion? Discuss.

Answered: 1 week ago

Question

Explain the guideline for job description.

Answered: 1 week ago

Question

What is job description ? State the uses of job description.

Answered: 1 week ago

Question

What are the objectives of job evaluation ?

Answered: 1 week ago

Question

Write a note on job design.

Answered: 1 week ago