by onesandzeros » Wed Feb 14, 2007 6:48 pm
by onesandzeros
Wed Feb 14, 2007 6:48 pm
iam trying to get mine werking right now.
i tried using this code from
http://www.robonova.de/store/support/index.php?_m=downloads&_a=downloadfile&downloaditemid=66
Code Example :
‘ calculation of measured value to metric distance in cm
‘ from Joerg Pohl, roboter-teile.de
DIM Gp2d12_val AS INTEGER
Read_gp2d12:
Gp2d12_val = AD (6) ‘ 6 here depends on AD port connection
IF Gp2d12_val < 4 THEN Gp2d12_val = 4 ‘Minimum setting
Gp2d12_val = Gp2d12_val - 3
Gp2d12_val = 6787 / Gp2d12_val
IF Gp2d12_val > 100 THEN Gp2d12_val = 0 ‘limit
For some reason, this code keep resetting my rn1 controller even if the sensor is removed.
i just wanted to do something simple like
IF Gp2d12_val < 100 THEN gosub wave_hands
Anyone have any idea how to make this work?
iam trying to get mine werking right now.
i tried using this code from
http://www.robonova.de/store/support/index.php?_m=downloads&_a=downloadfile&downloaditemid=66
Code Example :
‘ calculation of measured value to metric distance in cm
‘ from Joerg Pohl, roboter-teile.de
DIM Gp2d12_val AS INTEGER
Read_gp2d12:
Gp2d12_val = AD (6) ‘ 6 here depends on AD port connection
IF Gp2d12_val < 4 THEN Gp2d12_val = 4 ‘Minimum setting
Gp2d12_val = Gp2d12_val - 3
Gp2d12_val = 6787 / Gp2d12_val
IF Gp2d12_val > 100 THEN Gp2d12_val = 0 ‘limit
For some reason, this code keep resetting my rn1 controller even if the sensor is removed.
i just wanted to do something simple like
IF Gp2d12_val < 100 THEN gosub wave_hands
Anyone have any idea how to make this work?
Last edited by onesandzeros on Wed Feb 14, 2007 11:11 pm, edited 1 time in total.