Wheel Encoder Counter icon Wheel Encoder Counter Arduino UNO wheel encoder: reads left/right ticks, provides counts, configurable ticks, wheel & pivot sizes, optional pose telemetry to ARC NMS. Try it →
Canada
Asked — Edited

Adc Help - Uggg Frustrated

Hey All,

Trying to tweak my dome control scripts.

My Hot Pot potentiometer outputs a number from 0-212 on ADC7

Here is a few variations of the script I'm trying to use.

My main goal is to have the dome spin and stop on or close to the number I desire.

There is some momentum delay to stop but I can work that out.

Here are the scripts snipped from my main scripts Notes Added for clarification.

:CenterR
$DomePosition=GetADC(adc7)
ADC_Wait(adc7, EQUALS, 106) *Dome Center is 106*
Servo(D3, 50)   *Sets servo Control for Syren10 Full Stop*
Sleep(500)
Release(D3)
$DomeDirection=3 *Control Variable*
$DomeServo=50 *Control Variable*
Goto(Stop)

I've also tried with a little more luck.

:CenterR
$DomePosition=GetADC(adc7)
ADC_Wait_Between(adc7, 104, 107) *Dome Center is 106*
Servo(D3, 50)   *Sets servo Control for Syren10 Full Stop*
Sleep(500)
Release(D3)
$DomeDirection=3 *Control Variable*
$DomeServo=50 *Control Variable*
Goto(Stop)

The ADC_Wait never seems to catch the reading from ADC7 the first go around. I'm lucky if it catches it on spin 2 but sometimes it goes 3-4 times around before it catches it.

What am I doing wrong?

Am I going about this all wrong?

Suggestions? Cookies? Beer?

Kris


ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

Author Avatar
Canada
#9  

It's working great so far. I'm still fiddling with the delay but it's making my script above 100 times better now!

Once again DJ rocks!

Kris

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#10  

I think you offered cookies or beer to find a solution? I'll take both!:)

Author Avatar
Canada
#11  

Next trip in. I'll bring you guys and gals some goodies. ;)