Close Menu
primehub.blog

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    The Eater App Just Got a Lot Better

    March 25, 2026

    The BEST EVER Almond Flour Protein Pancakes

    March 25, 2026

    Discover Smart Servos with the Oxocard Connect

    March 25, 2026
    Facebook X (Twitter) Instagram
    primehub.blog
    Trending
    • The Eater App Just Got a Lot Better
    • The BEST EVER Almond Flour Protein Pancakes
    • Discover Smart Servos with the Oxocard Connect
    • The Hidden Reason You Need Digital Identity Verification Now
    • Asparagus and Marinated Artichoke Galette Recipe
    • Mould found in Edinburgh hospital ward sparks investigation
    • Sanders Blasts Bezos-owned Washington Post As He Unveils Federal 5% Wealth Tax Bill
    • Waterdrop Is Slashing Prices on Its Water Filtration Systems
    • Home
    • Health
    • Finance
    • Lifestyle
    • Food
    • Travel
    • DIY
    • Eco Living
    • Tech
    primehub.blog
    Home » Discover Smart Servos with the Oxocard Connect
    DIY

    Discover Smart Servos with the Oxocard Connect

    PrimeHubBy PrimeHubMarch 25, 2026No Comments3 Mins Read0 Views
    Share Facebook Twitter Pinterest LinkedIn Tumblr Email
    Discover Smart Servos with the Oxocard Connect
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Here the servo horn acts as an input device: when it is rotated, the measured angle is displayed on the screen.

    Now let’s look at the telemetry. Since the serial interface and the servo operate bidirectionally, various measured values can be continuously read out.

    In this exercise, we first move the servo to the center position and then deactivate the control. This allows the servo horn to be moved manually. The servo now acts as a sensor: The integrated potentiometer provides a numerical value between 0 and 1,000 over a rotation range of approximately 300 degrees.

    The servo has no fixed end stops — the servo horn can rotate a full 360 degrees. However, this potentiometer has a “blind spot” of approximately 50 to 60 degrees, where the potentiometer does not provide stable values, or jumps abruptly from the lower to the upper end of the measuring range. Within this gap the pot cannot be reliably used for angle measurement.

    The “Read Angle” script begins, as before, by initializing and centering the servo. The drive is then deactivated, and the current position is read every 100ms.

    Code example: Read Angle

    Line   Code
    1    import serial_servo
    2
    3    servoBus: SerialServoBus
    4    servoBus.init(C_PIN_02, C_PIN_01, 1000000)
    5    servoBus.setPosition(1,500,1000)
    6    delay(1000)
    7    servoBus.stopServo(1)
    8
    9    setInterval(100)
    10
    11   def onTimer():
    12       a = servoBus.getPosition(1)
    13       range300rad = 2.0*PI*0.821
    14       range300deg = deg(range300rad)
    15       ang = map(a,0,1000,0,range300 rad)
    16       push()
    17       translate(120,120)
    18       clear()
    19       fill(150,150,150)
    20       drawCircle(0,0,8)
    21       rotate(ang-(range300rad*0.5))
    22       drawRectangle(-2,-100,4,100)
    23       pop()
    24       textFont(FONT_ROBOTO_32)
    25       setPrecision(0)
    26       drawTextCentered(120, 180, (deg(map(a,0,1000,0,range300rad)) - range300deg/2) + "°")
    27       update()
    

    Explanation of the code

    • Lines 1–6: Initialize the servo library and position the servo in the center position.
    • Line 7: Deactivate the motor — the servo horn can now be moved manually (with slight resistance).
    • Lines 9–11: After each call to onTimer(), the current position of the server will be read. Line 9 sets an interval of 100ms (1/10 second) between calls.
    • Lines 11–15: After each call, the current position is read on line 12. This is a value between 0 and 1,000, which we convert into an angle on lines 13–15.
    • Lines 16–27: The drawing routine sets the origin to the center of the screen (translate) and rotates the drawing area around this point according to the calculated angle. Then a narrow pointer is drawn as a rectangle.

    NOTE: The graphics commands used here are explained in the introductory course that’s built into the NanoPy IDE, under Examples / Getting Started / Basics.

    Connect Discover Oxocard Servos smart
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    PrimeHub
    • Website

    Related Posts

    DIY

    Waterdrop Is Slashing Prices on Its Water Filtration Systems

    March 24, 2026
    DIY

    This Kitchen Ditched Its Dated Orange Tones for a Softer, More Modern Look

    March 22, 2026
    DIY

    Review: Liene PixCut S1 Sticker Printer

    March 21, 2026
    DIY

    12 Spring Cleaning Products for the Spots You Always Forget

    March 20, 2026
    DIY

    See Inside a Colorfully Transformed 1990s Dutch House

    March 17, 2026
    DIY

    This Laundry Hack Can Save You Time, Energy, and Money

    March 15, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Subscribe to News

    Get the latest sports news from NewsSite about world, sports and politics.

    Editor's Picks

    The Eater App Just Got a Lot Better

    March 25, 2026

    The BEST EVER Almond Flour Protein Pancakes

    March 25, 2026

    Discover Smart Servos with the Oxocard Connect

    March 25, 2026

    The Hidden Reason You Need Digital Identity Verification Now

    March 25, 2026
    Latest Posts

    20 Best Hotels in Tulum, From Luxury Resorts to Beach Bungalows

    August 24, 2025

    Things I Love at the Library

    August 24, 2025

    How to Test for Mold (Even If You Can’t See It)

    August 24, 2025
    Facebook Pinterest WhatsApp Instagram

    News

    • DIY
    • Eco Living
    • Finance
    • Food
    • Health

    catrgories

    • Lifestyle
    • Tech
    • Travel
    • DIY
    • Eco Living

    useful link

    • About Us
    • Contact us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    © 2026 primehub.blog. Designed by Pro.
    • About Us
    • Contact us
    • Disclaimer
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.