Question

ARDUINO Hi I'm trying to write a code for a personal project, but I haven't used...

ARDUINO

Hi I'm trying to write a code for a personal project, but I haven't used much arduino before. It's supposed to be a function where it takes in motor speed as an int and motor direction as a bool. The PWM is 8 bits. So it's supposed to be an asynchronous function where the blue is always at 50%, then it gets more green as it has a higher speed forward and more red as it has a higher speed backwards. It's supposed to be async, so running constantly without a delay. There should be if and for loops to find values. Thank you!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

n= no. of bits

f= frequency

s=slip

p=no. of pole

f1=n*f

ns=120*f1/p

nr1=ns*(1-s)

nr2=ns*(2+s)

if s>.5

print('blue')

print('nr1')

if s<.5

print('green')

print('nr2')

end

end

Add a comment
Know the answer?
Add Answer to:
ARDUINO Hi I'm trying to write a code for a personal project, but I haven't used...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED str...

    I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED strips and 3 - ultrasonics. I have them working independently but I need to combine the code so they work together. Here is what I have: Memory Game #define PLAYER_WAIT_TIME 2000 // The time allowed between button presses - 2s byte sequence[100]; // Storage for the light sequence byte curLen = 0; // Current length of the sequence byte inputCount =...

  • Why did the Energy Telematics project fail and why was Joel's tram vaught off guard by...

    Why did the Energy Telematics project fail and why was Joel's tram vaught off guard by the hostile reaction of the truck drivers at the Omaha depot? MINI CASE Working Smarter at Continental Furniture International Joel Parsons hurried down the hall to the monthly executive committee meeting doing a mental checklist of all the things he was responsible for: sales analysis-check; mar keting stats-check; quarterly and YTD financials-check; operating statistics-check trends in each of these areas-check. Parsons was right hand...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT