For instance, the value provide by a potentiometer could control the stepper-rotation. It can be used to create a direct relationship between an input and an output. Mapping is a way to translate a value from one range of numbers to another. Has the map function noticed? Here he is explained: Update - Mapping // Converts the read values of the potentiometer from 0 to 1023 into desired delay values (300 to 4000) The absolute value of a number is always positive. Int PotiValue = param.asInt() // assigning incoming value from pin V0 to a variableĪbsValue = abs(PotiValue) // abs( ) function in C returns the absolute value of an integer. BLYNK_WRITE(V0) // // Blynk app WRITES Slider widget Pay attention to the use of the function abs (), otherwise it will not work as expected. Two additional variables were added and instead of reading out A2, the values arriving from the slider are now linked with "virtual 0". The slightly changed code can be found as usual below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |