View unanswered posts | View active topics It is currently Fri Aug 22, 2014 7:52 am






Reply to topic  [ 6 posts ] 
hitechnic-protoboard bug 
Author Message
Rookie

Joined: Fri Jan 13, 2012 5:17 pm
Posts: 9
Post hitechnic-protoboard bug
The function that follows freezes the brick when executed. I am using 3.0b1 3rd party drivers.
Code:
inputdata = HTPBreadADC(HTPB, 0, 10)

The code above does not freeze the nxt in the file talked about below.
When i run the experimental code for the potentiometer, it displays -1 even though the potentiometer is configured correctly and it does not freeze the brick.
I am using hitechnic-protoboard-exp2.c for the experimental code.


Attachments:
File comment: This is the skematic used for the potentiometer
skematic of potentiometer.PNG
skematic of potentiometer.PNG [ 13.59 KiB | Viewed 3952 times ]
Sat Oct 06, 2012 12:19 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: hitechnic-protoboard bug
Hiya,

I will take a look at this tomorrow. Thanks for reporting 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]


Sat Oct 06, 2012 4:24 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: hitechnic-protoboard bug
I just realised that your drawing is one of the SuperPro. Did you try using the hitechnic-superpro-exp2.c file instead?

- 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]


Sun Oct 07, 2012 1:42 am
Profile WWW
Rookie

Joined: Fri Jan 13, 2012 5:17 pm
Posts: 9
Post Re: hitechnic-protoboard bug
That is the problem. I didn't know I was using the wrong one. Thank you for helping me out.


Sun Oct 07, 2012 1:52 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: hitechnic-protoboard bug
There is a bug in the superpro program :)
Use the program I just pasted below, I've tested it just a few minutes ago.
Code:
#include "drivers/hitechnic-superpro.h"

task main() {
  int inputdata;
  ubyte outputdata;
  int bit;

  // Set all digital IOs as outputs as output
  HTSPBsetupIO(HTSPB, 0xFF);

  while(true) {
    // Read a 10bit wide analogue value from A0
    inputdata = HTSPBreadADC(HTSPB, 0, 10);

    nxtDisplayTextLine(1, "A0: %d", inputdata);

    // Set the output bit based on the analogue input value
    bit = (inputdata/128);
    if (bit > 5) bit = 5;
    nxtDisplayTextLine(2, "Bit: %d", bit);
    outputdata = 1 << bit;
    HTSPBwriteIO(HTSPB, outputdata);
    wait1Msec(50);
  }
}

_________________
| 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]


Sun Oct 07, 2012 2:46 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3190
Location: Rotterdam, The Netherlands
Post Re: hitechnic-protoboard bug
This will be fixed in the next release of the suite, which should be coming out today, if all goes well :)

- 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]


Sun Oct 07, 2012 2:57 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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:  
cron



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