|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: potentiometer/ analog inputs
okay we'll try that.
|
|
#2
|
|||
|
|||
|
Re: potentiometer/ analog inputs
attempting analog channel didn't work when we added
float anglesh = pot1.GetVoltage(); |
|
#3
|
|||
|
|||
|
Re: potentiometer/ analog inputs
shouldn't it be pot1->GetVoltage();?
|
|
#4
|
|||
|
|||
|
Re: potentiometer/ analog inputs
i'm trying to make the code right and it compiles but we'll see if i get something.
i haven't actually had a potentiometer until now. |
|
#5
|
|||
|
|||
|
Re: potentiometer/ analog inputs
1075guy is right, because you declared it using a pointer you must use -> instead of .
|
|
#6
|
||||
|
||||
|
Re: potentiometer/ analog inputs
use pot1->GetValue() for a 0-1023 range value, pot1->GetVoltage() for 0.0-5.0 range. Try both and see which one you like better
|
|
#7
|
|||
|
|||
|
Re: potentiometer/ analog inputs
i try printing the values to the screen and i get really big values sometimes. Why would this be? is it because i might run the loops they are in too quuickly. i set them to .02 seconds and i think its doing better.
I actually disabled the watchdog for the autonomous because it won't run through long waits in the system. this worked until just now when it started giving me watchdog not fed errors that have never happened before. |
|
#8
|
|||||
|
|||||
|
Re: potentiometer/ analog inputs
Perhaps there's a digit or two left over on the screen from a previous print step? For example, if one value is 1003 and the next one is 996, it might end up on screen looking like 9963 if you aren't careful.
|
|
#9
|
|||
|
|||
|
Re: potentiometer/ analog inputs
this could be i will try to fix this.
would printing printf(" =angletop"); printf("%d",angletop); would this work in the correct format assuming it prints on line 1 and the %d writes over it? |
|
#10
|
||||
|
||||
|
Re: potentiometer/ analog inputs
Quote:
Code:
=angletop23 =angletop85 =angletop712 =angletop465 =angletop84 =angletop6 =angletop4586 =angletop589 =angletop486 |
|
#11
|
|||
|
|||
|
Re: potentiometer/ analog inputs
we only need the number to print when autonomous is done. basically we have a 5 second waiting period where we find the values.
right now i just found out that the pot is mounted so up is down and down is up. so i'll need to get someone to remount it. |
|
#12
|
||||
|
||||
|
Re: potentiometer/ analog inputs
Or you can correct it in software.
Code:
angletop = max - angletop; |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! Analog Inputs!! | brennerator | Programming | 7 | 11-02-2007 15:48 |
| Analog Inputs | bush | Programming | 5 | 13-03-2006 17:49 |
| Analog Inputs prob. | Bharat Nain | Programming | 2 | 07-02-2004 20:48 |
| Failing analog inputs? | Phasmatis568 | Control System | 5 | 22-01-2004 13:28 |
| Analog Inputs | 316_programer | Technical Discussion | 2 | 05-02-2002 05:53 |