ROBOTC.net forums
http://robotc.net/forums/

hitechnic-protoboard bug
http://robotc.net/forums/viewtopic.php?f=41&t=4951
Page 1 of 1

Author:  recondelta090 [ Sat Oct 06, 2012 12:19 pm ]
Post subject:  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 9024 times ]

Author:  mightor [ Sat Oct 06, 2012 4:24 pm ]
Post subject:  Re: hitechnic-protoboard bug

Hiya,

I will take a look at this tomorrow. Thanks for reporting it.

- Xander

Author:  mightor [ Sun Oct 07, 2012 1:42 am ]
Post subject:  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

Author:  recondelta090 [ Sun Oct 07, 2012 1:52 am ]
Post subject:  Re: hitechnic-protoboard bug

That is the problem. I didn't know I was using the wrong one. Thank you for helping me out.

Author:  mightor [ Sun Oct 07, 2012 2:46 am ]
Post subject:  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);
  }
}

Author:  mightor [ Sun Oct 07, 2012 2:57 am ]
Post subject:  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

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/