To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 6864
6863  |  6865
Subject: 
RE: Retrieving data from the handyboard
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Thu, 7 Oct 1999 03:59:06 GMT
Original-From: 
Sean Verret <verret@IHATESPAMee.ualberta.ca>
Viewed: 
982 times
  
Interactive C can't handle 2D or 3D arrays.... instead another method needs
to be used..

If your matrix was a 3X3

789
456
123

and rows went from bottom to top and columns from left to right

then you'd have to come up with a formula using the row and column numbers
to access each cell

for example in this configuration you can access any of the cells using the
formula

let the row# = j
let the col# = i

total number of rows = J
total number of cols = I

cell# = (j-1)*J+i

or if the matrix is like so

369
258
147

cell# = (i-1)*I+j

I've never tried for a 3D array but assuming that there was a layer on top
of the second matrix shown, with the same pattern...

depth# = k
total depths = K

cell# = (i-1)*I+j+(I*J)*(k-1)

Hope that helps if you can follow the variables....

.-----Original Message-----
.From: news-gateway@lugnet.com [mailto:news-gateway@lugnet.com]On Behalf
.Of Bob Baxley
.Sent: Wednesday, October 06, 1999 4:39 PM
.To: handyboard@media.mit.edu
.Subject: Retrieving data from the handyboard
.
.
.I need to transfer the data in a matrix on the HB to my win98 PC?  I know a
.special program is necessary to interpret the signals going to the
.COM port.
.Does anyone have such a program or have the have some code that I
.can compile
.with VS 6.0?  Here is the function I am using:
.
.
.int map[15][15][5];
.void output()
. {
.
. int v=0;
. int h=0;
. int o=0;
. for(v = 0; v<15; v++) {
. for(h=0; h<15; h++) {
. for(o=0; o<5; o++){
.                       serial_putchar(map[v][h][o]);
. }
. }
. }
. }
.



Message is in Reply To:
  Retrieving data from the handyboard
 
I need to transfer the data in a matrix on the HB to my win98 PC? I know a special program is necessary to interpret the signals going to the COM port. Does anyone have such a program or have the have some code that I can compile with VS 6.0? Here (...) (25 years ago, 6-Oct-99, to lugnet.robotics.handyboard)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR