in Education by
The Arduino map() function does not work for this problem, and HAVE scoured the 'net for examples but am still coming up at a loss. My 'math-brain' is ded!! :-( I have a pot going into an Arduino analog input produces a range of 170 to 1000. I'd like to scale that to a range of -1 to 1 to simulate a commercial joystick that is being replaced. There is an Arduino Micro reading the pots and sending the data by serial to Processing. This all works - just can't get the -1 to 1 range to send out. A formula to do this would be a HUGE help! =Alan R. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can use linear interpolation to do the magic. If x is the input and y is your desired output, the following relation will work out: (y-1)/(x-1000) = (1-(-1))/(1000-170) = 1/415 So basically, y = 1 + (x-1000)/415

Related questions

0 votes
    1. has invented Analog Computer. (Lord Ripon , Lord Convene, Charles Babbage) 2. Full form of 4GL is in the ... (Super, Micro, Mini) Select the correct answer from above options...
asked Dec 20, 2021 in Education by JackTerrance
0 votes
    What first-aid should be given for injuries like sprains, twisting and contusion? Select the correct ... proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    How is Raspberry Pi different from Arduino?...
asked Jan 20, 2023 in Education by JackTerrance
0 votes
    I'm trying to use node to print the Serial from Arduino uno connected to USB I have a file script ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    Why is it essential to get the training of first aid? Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    The speech signal is obtained after a. Analog to digital conversion b. Digital to analog conversion c. Modulation d. Quantization. Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    Write short note on- Principles of first aid Select the correct answer from above options Science ... Science proposed by,electromagnetic theory engineering physics,Science nptel...
asked Nov 7, 2021 in Education by JackTerrance
0 votes
    What is Analog mode? What is its functionality?...
asked Oct 19, 2020 in Technology by JackTerrance
0 votes
    The horizontal scaling approach tends to be cheaper as the number of operations, and the size of the data increases. 1. True 2. False...
asked Sep 6, 2021 in Technology by JackTerrance
0 votes
    (a) What will be the output of the following Python code? from math import factorial print (math.factorial (5) ... : print(factorial(5) Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    In Java, what will be the output of the following code and how? double x=2.9,y=2.5; (SOP is abbreviated form ... x),y)); Explain how Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    Can math operations be performed on a void pointer?...
asked Jan 22, 2021 in Technology by JackTerrance
0 votes
    Which compiler switch to be used for compiling the programs using math library with gcc compiler?...
asked Jan 18, 2021 in Technology by JackTerrance
+1 vote
    Which compiler switch to be used for compiling the programs using math library with gcc compiler?...
asked Nov 9, 2020 in Technology by JackTerrance
0 votes
    Consider the reaction : Cr2O 2- 7 +14H++6e-→2Cr3++7H2O What is the quantity of electricity in coulombs needed to ... Cr2O 2- 7 ? Select the correct answer from above options...
asked Jan 5, 2022 in Education by JackTerrance
...