Modify the Joystick code
Modified to the correct ADC input pin
This commit is contained in:
@@ -30,8 +30,8 @@ int main(void){
|
||||
|
||||
while(1){
|
||||
val_Z = digitalRead(Z_Pin); //read digital quality of axis Z
|
||||
val_Y = analogRead(A1); //read analog quality of axis X and Y
|
||||
val_X = analogRead(A2);
|
||||
val_Y = analogRead(A0); //read analog quality of axis X and Y
|
||||
val_X = analogRead(A1);
|
||||
printf("val_X: %d ,\tval_Y: %d ,\tval_Z: %d \n",val_X,val_Y,val_Z);
|
||||
delay(100);
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ def setup():
|
||||
def loop():
|
||||
while True:
|
||||
val_Z = GPIO.input(Z_Pin) #read digital quality of axis Z
|
||||
val_Y = analogRead(1) #read analog quality of axis X and Y
|
||||
val_X = analogRead(2)
|
||||
val_Y = analogRead(0) #read analog quality of axis X and Y
|
||||
val_X = analogRead(1)
|
||||
print 'value_X: %d ,\tvlue_Y: %d ,\tvalue_Z: %d'%(val_X,val_Y,val_Z)
|
||||
time.sleep(0.01)
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user