View unanswered posts | View active topics It is currently Sat Aug 27, 2016 2:48 pm






Reply to topic  [ 15 posts ] 
3rd Party IR sensor acting strange 
Author Message
Rookie

Joined: Tue Apr 21, 2015 1:21 pm
Posts: 3
Post 3rd Party IR sensor acting strange
Hey everyone,

I have been toying around with the 3rd party hightechnic IR sensor for the EV3 and it seems to only be registering the very first value that it is exposed to, i.e. if I start the program and the sensor registers the the infared ball is front of it it will move toward it as intended. However, it will ignore any changes in direction of the infared ball and still treat it as if it was still in front ( Even when the ball is directly behind it!).

I have activated the required directories to use the sensor and I am fairly sure the code is useable. I have worked with the same sensor using the NXT 2.x and it was running fine until I used it for EV3. Is there something I'm missing or neglecting to do? I apologize for any vagueness but any help is appreciated!

Thanks,
Ssuperbull


Tue Apr 21, 2015 1:38 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
You are using the latest version of the driver suite from https://github.com/botbench/robotcdriversuite?
If you are, please make sure you're also using ROBOTC 4.30. Let me know which one of the example programs you're having this issue with. If it's your own code, please verifiy that you have the same issue with the examples. Otherwise, attach your program to the next post.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Apr 21, 2015 1:55 pm
Profile WWW
Rookie

Joined: Tue Apr 21, 2015 1:21 pm
Posts: 3
Post Re: 3rd Party IR sensor acting strange
Thanks for the quick reply! I'm fairly new to coding so please go easy on me, haha. Also, something worth noting, when i go to port view on my EV3 it does not show the values of the infared detection unless I unplug the sensor and plug it back in. I just thought was strange.



Code:
#pragma config(Sensor, S1,     lightSensor1,   sensorEV3_Color)
#pragma config(Sensor, S2,     infraredSensor, sensorI2CCustom)
#pragma config(Sensor, S4,     sonarSensor,    sensorSONAR)
#pragma config(Motor,  motorB,           ,             tmotorEV3_Large, PIDControl, reversed, encoder)
#pragma config(Motor,  motorC,           ,             tmotorEV3_Large, PIDControl, reversed, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

/*!!Code automatically generated by 'ROBOTC' configuration wizard               !!
Code courtesy of ******************
The #pragma is an automatically generated piece of code that is created when you
activate a sensor in the "Motor and Sensor Setup"
*/
#include "hitechnic-irseeker-v2.h" //This is the library for the IR sensor

task main()//this is the main function of the program
{
   nMotorPIDSpeedCtrl[motorB]=mtrSpeedReg;//Initializes the motor B
   nMotorPIDSpeedCtrl[motorC]=mtrSpeedReg;//Initializes the motor C

   // next several lines set up the IR sensor

   tHTIRS2 irSeeker; //Create struct (of type tHTIRS2) to hold sensor data
   initSensor(&irSeeker, S2); // Initialise and configure struct and port

   irSeeker.mode=DSP_1200; //Sets the frequency the IR sensor picks up "1200 Hz"

   int dirAC = 0; //Creates a local variable and initializes it at zero
   readSensor(&irSeeker); //??
   dirAC = irSeeker.acDirection; //??

   while(true)//A continuous loop
   {   if (SensorValue(lightSensor1) >= 10) //Keeps the robot on the board
      {   //motor[motorB] = -50;
         //motor[motorC] = 50;

         if (dirAC < 5 && dirAC >= 0)
         {   motor[motorB] = 60;
            motor[motorC] = 40;
         }
         else if (dirAC > 5 && dirAC <= 9)
         {   motor[motorB] = 40;
            motor[motorC] = 60;
         }
         else
         { motor[motorB] = 100;
            motor[motorC] = 100;
        }
      }
      else //In any other circumstance the robot will reverse direction and rotate
      { motor[motorB] = -100;
         motor[motorC] = -100;
         wait1Msec(2000);

         motor[motorB] = 50;
         motor[motorC] = -50;
         wait1Msec(500);
      }
}
}


Tue Apr 21, 2015 2:26 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
Hey there,

Could you answer these two questions for me as well?
Are you using the latest version of the driver suite from https://github.com/botbench/robotcdriversuite?
Does it work properly with the examples?

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Apr 21, 2015 2:41 pm
Profile WWW
Rookie

Joined: Tue Apr 21, 2015 1:21 pm
Posts: 3
Post Re: 3rd Party IR sensor acting strange
Hey again,
I don't believe I have the driver downloaded. I have been going through the directory files to grab the Hightechnic file to use, but it seems glitchy. What exactly should I download to get this working?


Thu Apr 23, 2015 2:28 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
Scroll down a bit on https://github.com/botbench/robotcdriversuite and follow the instructions :)

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Apr 23, 2015 3:54 pm
Profile WWW
Rookie

Joined: Tue May 24, 2011 10:22 am
Posts: 5
Post Re: 3rd Party IR sensor acting strange
After downloading the drivers..
How do I install them?


Fri May 01, 2015 9:11 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
It's on that page in the section titled "How to install it?"

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri May 01, 2015 9:19 am
Profile WWW
Rookie

Joined: Tue May 24, 2011 10:22 am
Posts: 5
Post Re: 3rd Party IR sensor acting strange
Could you send me a link. I did not get that file when I unzipped.


Fri May 01, 2015 9:25 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
It's not a file. It's on the same page as where you donwloaded the zip file: https://github.com/botbench/robotcdriversuite. Just scroll down a bit. You can't miss it.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri May 01, 2015 9:32 am
Profile WWW
Rookie

Joined: Tue May 24, 2011 10:22 am
Posts: 5
Post Re: 3rd Party IR sensor acting strange
Okay. Having a few problems in my school district.
First, for some reason we cannot open any of the links you have. I was able to use my personal computer and my phone to get to the page.
Second, the only direction id see is to "expand on you system, somewhere"
How do I get the driver from the computer to the EV3


Fri May 01, 2015 9:48 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
Quote:
How do I get the driver from the computer to the EV3

You don't. The compiler will take care of that when you upload your program to the brick. After you have installed the drivers according to the instructions, take a look at some of the examples that are included with the suite. They will explain how to use the drivers.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri May 01, 2015 9:54 am
Profile WWW
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: 3rd Party IR sensor acting strange
Quote:
Second, the only direction id see is to "expand on you system, somewhere"

What about the rest of the text:
Quote:
If you're keen to try out these bleeding edge drivers, navigate to this page and follow the instructions. Simply substitute the repository in that text with this current one.


= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri May 01, 2015 9:56 am
Profile WWW
Rookie

Joined: Tue May 24, 2011 10:22 am
Posts: 5
Post Re: 3rd Party IR sensor acting strange
okay thanks anyway


Fri May 01, 2015 10:29 am
Profile
Rookie

Joined: Mon Jun 13, 2016 5:09 am
Posts: 5
Post Re: 3rd Party IR sensor acting strange
After downloading the drivers..
How do I install them????????

_________________
Call Conference ||Conference Calling Plugin ||Telephone Conference Calling


Mon Jun 13, 2016 6:40 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 15 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.