SensorPort, SetSensorPin and readSensorPin on EV3?

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

SensorPort, SetSensorPin and readSensorPin on EV3?

Postby VitorRibeiroSK » Fri Mar 14, 2014 3:06 am

Hi :D ,

Sorry I'm using Google Translator

The Lejos NXJ API exists of a class " SensorPort " which allows me to access a port sensor and allows me to read and write ( Input and Output ) pins directly , specifically on pins 1 , 2 , 5 and 6 can be used with I / O or analog input . I could not find anything like the source code of Lejos EV3 , there is a " SensorPort " interface but by being an interface does not implement anything other than where SensorPort NXJ is a class . Also the EV3 documentation is not available for some time .

It is possible in EV3 I directly access the pins of a sensor to develop a class that controls a sensor not provided by the API Lejos , How do I access this in EV3 ?
:?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?: :?:

I would take a few sensors I used on old arduino projects , but some of them do not communicate nor UART , I2C or by . According to documentation lego 6 wires from the sensors are:
Pin 1: 5V ADC , PU
Pin 2: I / O, PU , PD
Pin 3 : Ground
Pin 4 : +20 V 5 mA
Pin 5 : I / O, PU, SCK (i2C) , TX (uart)
Pin 6 : I / O, ADC 5V , PD , SDA(i2c) , RX(uart)

I would go directly to pins 1 , 2 , 5 and 6 as I / O / Analog and thus create an implementation for my sensors .

Anyone know a way ?

Thank you.
VitorRibeiroSK
New User
 
Posts: 2
Joined: Fri Mar 14, 2014 3:00 am

Re: SensorPort, SetSensorPin and readSensorPin on EV3?

Postby gloomyandy » Fri Mar 14, 2014 8:26 am

Things are different on the EV3. We do not currently support direct access to these pins. Access is currently via a Linux kernel module which provides limited access. You can basically read analog values on two of the pins, and adjust the sensor mode (which sets values on two of the other pins). There is not much documentation of this at the moment, you can see what is possible by looking at the source code:
https://sourceforge.net/p/lejos/ev3/ci/ ... nager.java
https://sourceforge.net/p/lejos/ev3/ci/ ... gPort.java
https://sourceforge.net/p/lejos/ev3sdca ... d_analog.c

We may change this at some point but it is not high on the priority list at the moment.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: SensorPort, SetSensorPin and readSensorPin on EV3?

Postby VitorRibeiroSK » Sun Mar 16, 2014 11:29 pm

Thanks :)
VitorRibeiroSK
New User
 
Posts: 2
Joined: Fri Mar 14, 2014 3:00 am


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff