| 1 |
From [email protected] Wed Jul 1 13:17:17 1998 |
| 2 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 3 |
id AA10324; Wed, 1 Jul 1998 13:17:17 -0400 |
| 4 |
Received: from comp.uark.edu ([email protected] [130.184.252.197]) |
| 5 |
by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id LAA00083 |
| 6 |
for <[email protected]>; Wed, 1 Jul 1998 11:56:44 -0400 (EDT) |
| 7 |
Received: from comp.uark.edu (IDENT:[email protected] [130.184.201.233]) |
| 8 |
by comp.uark.edu (8.9.0/8.9.0) with ESMTP id KAA12202; |
| 9 |
Wed, 1 Jul 1998 10:56:30 -0500 (CDT) |
| 10 |
Sender: [email protected] |
| 11 |
Message-Id: <[email protected]> |
| 12 |
Date: Wed, 01 Jul 1998 10:56:30 -0500 |
| 13 |
From: Douglas Blank <[email protected]> |
| 14 |
Organization: University of Arkansas, CS |
| 15 |
X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.33 i686) |
| 16 |
Mime-Version: 1.0 |
| 17 |
To: Aaron Edsinger <[email protected]> |
| 18 |
Cc: handy <[email protected]> |
| 19 |
Subject: Re: Serial Interface |
| 20 |
References: <[email protected]> |
| 21 |
Content-Type: text/plain; charset=us-ascii |
| 22 |
Content-Transfer-Encoding: 7bit |
| 23 |
|
| 24 |
Aaron Edsinger wrote: |
| 25 |
|
| 26 |
> Hello, |
| 27 |
> I've been having some problems using my HandyBoard to talk directly to my |
| 28 |
> PC via the serial interface. I disable Interactive C and then Poke() and |
| 29 |
> Peek() as has been described on this list. I send short character strings |
| 30 |
> from my PC to the HandyBoard under Windows 95. If I send strings longer |
| 31 |
> than 2 characters, it seems that some of the characters get lost. This |
| 32 |
> behavior seems to be affected by repositioning or slightly modifying the |
| 33 |
> code, suggesting perhaps a timing issue. |
| 34 |
|
| 35 |
Although there is the HEXMON program, I too, have been trying to do what |
| 36 |
you describe, and encountered the same problems. I found it to be a |
| 37 |
timing issue, and, through trial and error, have a found some settings |
| 38 |
that seem to work most of the time. |
| 39 |
|
| 40 |
My goal was to make C code that looked the same when compiled and run on |
| 41 |
the Host is the code that ran under IC. |
| 42 |
|
| 43 |
I am including the host and HB programs here. If anyone knows of a |
| 44 |
better way of communicating, please let us know. |
| 45 |
|
| 46 |
-Doug Blank |
| 47 |
|
| 48 |
===================================================================== |
| 49 |
[email protected] Douglas Blank, University of Arkansas |
| 50 |
Assistant Professor Computer Science |
| 51 |
==================== http://www.uark.edu/~dblank ==================== |
| 52 |
|
| 53 |
This code was written for MS C++4.0 running on Win95. |
| 54 |
|
| 55 |
//************** BEGIN: serial_HOST.c |
| 56 |
|
| 57 |
/* VC++4.0 HandyBoard Host Programming System |
| 58 |
Dr. Douglas S. Blank |
| 59 |
University of Arkansas, Department of Computer Science |
| 60 |
www.uark.edu/~dblank |
| 61 |
|
| 62 |
This code runs on a host PC. |
| 63 |
*/ |
| 64 |
|
| 65 |
#include <ctype.h> |
| 66 |
#include <conio.h> |
| 67 |
#include <stdlib.h> |
| 68 |
#include <stdio.h> |
| 69 |
|
| 70 |
#include "serial_HOST.h" |
| 71 |
|
| 72 |
void main(int argc, char *argv[]) |
| 73 |
{ |
| 74 |
motor(0, 100); |
| 75 |
motor(1, 100); |
| 76 |
motor(2, 100); |
| 77 |
motor(3, 100); |
| 78 |
sleep(1000); |
| 79 |
motor(0, -100); |
| 80 |
motor(1, -100); |
| 81 |
motor(2, -100); |
| 82 |
motor(3, -100); |
| 83 |
sleep(1000); |
| 84 |
ao(); |
| 85 |
print("\nThis is a test"); |
| 86 |
printf("Knob is %d\n", knob() ); |
| 87 |
printf("Analog(0) is %d\n", analog(0)); |
| 88 |
printf("Digital(0) is %d\n", digital(0)); |
| 89 |
printf("Analog(1) is %d\n", analog(1)); |
| 90 |
printf("Digital(1) is %d\n", digital(1)); |
| 91 |
printf("Analog(2) is %d\n", analog(2)); |
| 92 |
printf("Digital(2) is %d\n", digital(2)); |
| 93 |
printf("Analog(3) is %d\n", analog(3)); |
| 94 |
printf("Digital(3) is %d\n", digital(3)); |
| 95 |
printf("Analog(4) is %d\n", analog(4)); |
| 96 |
printf("Digital(4) is %d\n", digital(4)); |
| 97 |
printf("Analog(5) is %d\n", analog(5)); |
| 98 |
printf("Digital(5) is %d\n", digital(5)); |
| 99 |
printf("Analog(6) is %d\n", analog(6)); |
| 100 |
printf("Digital(6) is %d\n", digital(6)); |
| 101 |
printf("Analog(7) is %d\n", analog(7)); |
| 102 |
printf("Digital(7) is %d\n", digital(7)); |
| 103 |
printf("Analog(8) is %d\n", analog(8)); |
| 104 |
printf("Digital(8) is %d\n", digital(8)); |
| 105 |
printf("Analog(9) is %d\n", analog(9)); |
| 106 |
printf("Digital(9) is %d\n", digital(9)); |
| 107 |
printf("Analog(10) is %d\n", analog(10)); |
| 108 |
printf("Digital(10) is %d\n", digital(10)); |
| 109 |
printf("Analog(11) is %d\n", analog(11)); |
| 110 |
printf("Digital(11) is %d\n", digital(11)); |
| 111 |
printf("Analog(12) is %d\n", analog(12)); |
| 112 |
printf("Digital(12) is %d\n", digital(12)); |
| 113 |
printf("Analog(13) is %d\n", analog(13)); |
| 114 |
printf("Digital(13) is %d\n", digital(13)); |
| 115 |
printf("Analog(14) is %d\n", analog(14)); |
| 116 |
printf("Digital(14) is %d\n", digital(14)); |
| 117 |
printf("Analog(15) is %d\n", analog(15)); |
| 118 |
printf("Digital(15) is %d\n", digital(15)); |
| 119 |
beep(); |
| 120 |
sleep(1000); |
| 121 |
while (! stop_button() ) { |
| 122 |
sprintf(buffer, "%d.0", (knob() * 10)); |
| 123 |
tone( buffer, "0.1"); |
| 124 |
} |
| 125 |
} |
| 126 |
|
| 127 |
//************** END: serial_HOST.c |
| 128 |
|
| 129 |
//************** BEGIN: serial_HOST.h |
| 130 |
|
| 131 |
/* VC++4.0 HandyBoard Host Programming System |
| 132 |
Dr. Douglas S. Blank |
| 133 |
University of Arkansas, Department of Computer Science |
| 134 |
www.uark.edu/~dblank |
| 135 |
*/ |
| 136 |
|
| 137 |
#define MOTOR 0 |
| 138 |
#define AO 1 |
| 139 |
#define ANALOG 2 |
| 140 |
#define DIGITAL 3 |
| 141 |
#define PRINTF 4 |
| 142 |
#define KNOB 5 |
| 143 |
#define BEEP 6 |
| 144 |
#define TONE 7 |
| 145 |
#define START_BUTTON 8 |
| 146 |
#define STOP_BUTTON 9 |
| 147 |
#define QUIT 113 |
| 148 |
|
| 149 |
#define sleep(NUM) _sleep(NUM) |
| 150 |
#define SERIALWAIT 5 |
| 151 |
|
| 152 |
unsigned short PORT = 0x3f8; // LPT1: 0x378 COM1: 0x3f8 |
| 153 |
|
| 154 |
int send(int i) { |
| 155 |
int retval; |
| 156 |
retval = _outp( PORT, i); |
| 157 |
_sleep(SERIALWAIT); |
| 158 |
return retval; |
| 159 |
} |
| 160 |
|
| 161 |
int receive() { |
| 162 |
int retval; |
| 163 |
retval = _inp( PORT); |
| 164 |
_sleep(SERIALWAIT); |
| 165 |
retval = _inp( PORT); |
| 166 |
return retval; |
| 167 |
} |
| 168 |
|
| 169 |
void hangup() { |
| 170 |
send(QUIT); |
| 171 |
} |
| 172 |
|
| 173 |
void print(char buffer[]) { |
| 174 |
int i; |
| 175 |
send(PRINTF); |
| 176 |
for (i = 0; buffer[i] != 0; i++) |
| 177 |
send(buffer[i]); |
| 178 |
send('\0'); |
| 179 |
} |
| 180 |
|
| 181 |
void motor(int motornum, int power) { |
| 182 |
send(MOTOR); |
| 183 |
send(motornum); |
| 184 |
send(power + 100); // taken off on the other end |
| 185 |
} |
| 186 |
|
| 187 |
int analog(int sensor) { |
| 188 |
send(ANALOG); |
| 189 |
send(sensor); |
| 190 |
return receive(); |
| 191 |
} |
| 192 |
|
| 193 |
int digital(int sensor) { |
| 194 |
send(DIGITAL); |
| 195 |
send(sensor); |
| 196 |
return receive(); |
| 197 |
} |
| 198 |
|
| 199 |
void ao() { |
| 200 |
send(AO); |
| 201 |
} |
| 202 |
|
| 203 |
int knob() { |
| 204 |
send(KNOB); |
| 205 |
return receive(); |
| 206 |
} |
| 207 |
|
| 208 |
void beep() { |
| 209 |
send(BEEP); |
| 210 |
} |
| 211 |
|
| 212 |
void tone(char f1[], char f2[]) { |
| 213 |
int i; |
| 214 |
send(TONE); |
| 215 |
for (i = 0; f1[i] != 0; i++) |
| 216 |
send(f1[i]); |
| 217 |
send('\0'); |
| 218 |
for (i = 0; f2[i] != 0; i++) |
| 219 |
send(f2[i]); |
| 220 |
send('\0'); |
| 221 |
_sleep((unsigned long) (atof(f2) * 1000)); // to keep from |
| 222 |
overflowing serial line |
| 223 |
} |
| 224 |
|
| 225 |
void interactive() |
| 226 |
{ |
| 227 |
char c; |
| 228 |
char key = ' '; |
| 229 |
while (key != 'q') { |
| 230 |
key = getch(); |
| 231 |
send(key); |
| 232 |
printf("Sent %c\n", key); |
| 233 |
c = receive(); |
| 234 |
printf("Got %c as a return value\n", c); |
| 235 |
} |
| 236 |
} |
| 237 |
|
| 238 |
int start_button() { |
| 239 |
send(START_BUTTON); |
| 240 |
return receive(); |
| 241 |
} |
| 242 |
|
| 243 |
int stop_button() { |
| 244 |
send(STOP_BUTTON); |
| 245 |
return receive(); |
| 246 |
} |
| 247 |
//************** END: serial_HOST.h |
| 248 |
|
| 249 |
//************** BEGIN: serial_HB.c |
| 250 |
|
| 251 |
/* VC++4.0 HandyBoard Programming System |
| 252 |
(Parts taken from other HB programs) |
| 253 |
Dr. Douglas S. Blank |
| 254 |
University of Arkansas, Department of Computer Science |
| 255 |
www.uark.edu/~dblank |
| 256 |
|
| 257 |
This code runs on the HB |
| 258 |
*/ |
| 259 |
|
| 260 |
#define MOTOR 0 |
| 261 |
#define AO 1 |
| 262 |
#define ANALOG 2 |
| 263 |
#define DIGITAL 3 |
| 264 |
#define PRINTF 4 |
| 265 |
#define KNOB 5 |
| 266 |
#define BEEP 6 |
| 267 |
#define TONE 7 |
| 268 |
#define START_BUTTON 8 |
| 269 |
#define STOP_BUTTON 9 |
| 270 |
#define QUIT 113 |
| 271 |
|
| 272 |
int _isspace(int a) /* returns 1 for space or tab, 0 |
| 273 |
otherwise */ |
| 274 |
/* internal routine used by atof() and |
| 275 |
cgets() */ |
| 276 |
|
| 277 |
{ |
| 278 |
return ((a == 32) || (a == 9)); /* 32 is space, 9 is tab */ |
| 279 |
} |
| 280 |
|
| 281 |
/*****************************************************************************/ |
| 282 |
|
| 283 |
int _isdigit(int a) /* returns 1 if a digit 0-9, 0 otherwise */ |
| 284 |
/* internal routine used by atof() */ |
| 285 |
|
| 286 |
{ |
| 287 |
return ((a >= 48) && (a <= 57)); /* 48 is '0', 57 is '9' */ |
| 288 |
} |
| 289 |
|
| 290 |
float atof(char s[]) /* Convert a string containing a number in |
| 291 |
ASCII */ |
| 292 |
/* form (integer, float, or exponential float) |
| 293 |
to a */ |
| 294 |
/* float. Strips whitespace characters (space |
| 295 |
and */ |
| 296 |
/* tab) from the front of the string, but |
| 297 |
stops */ |
| 298 |
/* parsing at the first (unexpected) |
| 299 |
non-numeric */ |
| 300 |
/* character if the string has garbage at the |
| 301 |
end. */ |
| 302 |
/* This means that " 34.3foo78" translates to |
| 303 |
34.3. */ |
| 304 |
/* Modified from atof() function in the |
| 305 |
standard */ |
| 306 |
/* library of the Hi-Tec C compiler for |
| 307 |
CP/M. */ |
| 308 |
/* Note: all string literals converted to |
| 309 |
decimal */ |
| 310 |
/* form because IC can't deal with string |
| 311 |
literals */ |
| 312 |
/* in math |
| 313 |
calculations. */ |
| 314 |
/* Also note: very ugly code because IC will |
| 315 |
not */ |
| 316 |
/* allow any math operations on pointers! Thus, |
| 317 |
the */ |
| 318 |
/* the number string has to be treated as an |
| 319 |
array! */ |
| 320 |
/* Also also note: no error handling; assumes |
| 321 |
that */ |
| 322 |
/* the string is a valid representation of a |
| 323 |
number! */ |
| 324 |
/* Valid range for exponential-format numbers |
| 325 |
is */ |
| 326 |
/* approximately 2.0e-38 to |
| 327 |
3.4e+38. */ |
| 328 |
|
| 329 |
{ |
| 330 |
int i=0; /* index into string array */ |
| 331 |
int sign=0; /* mantissa sign flag: 0=positive, |
| 332 |
1=negative */ |
| 333 |
int exp0=0; /* mantissa exponent counter */ |
| 334 |
int eexp=0; /* E-form exponent counter */ |
| 335 |
int expsign=0; /* exponent sign flag: 0=positive, |
| 336 |
1=negative */ |
| 337 |
float m=0.0; /* mantissa accumulator */ |
| 338 |
|
| 339 |
/* skip any leading whitespace (space, tab) */ |
| 340 |
while (_isspace(s[i])) |
| 341 |
i++; /* skip it */ |
| 342 |
|
| 343 |
/* check for mantissa sign */ |
| 344 |
if (s[i] == 45) /* 45 is '-' */ |
| 345 |
{ |
| 346 |
sign = 1; /* flag minus sign */ |
| 347 |
i++; /* point to next */ |
| 348 |
} |
| 349 |
else if (s[i] == 43) /* 43 is '+' */ |
| 350 |
i++; /* point to next */ |
| 351 |
|
| 352 |
/* now get all digits up to either a decimal point or an e/E */ |
| 353 |
while (_isdigit(s[i])) |
| 354 |
{ |
| 355 |
m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ |
| 356 |
i++; /* point to next */ |
| 357 |
} |
| 358 |
|
| 359 |
/* no more digits, so check for decimal point */ |
| 360 |
if (s[i] == 46) /* 46 is '.' */ |
| 361 |
{ |
| 362 |
i++; /* point to next */ |
| 363 |
/* get all digits after decimal point */ |
| 364 |
while (_isdigit(s[i])) |
| 365 |
{ |
| 366 |
exp0--; |
| 367 |
m = 10.0*m + (float)(s[i] - 48); /* 48 is '0' */ |
| 368 |
i++; /* point to next */ |
| 369 |
} |
| 370 |
} |
| 371 |
|
| 372 |
/* check for e/E exponential form */ |
| 373 |
if ((s[i] == 101) || (s[i] == 69)) /* 101 is 'e', 69 is 'E' */ |
| 374 |
{ |
| 375 |
i++; /* point to next */ |
| 376 |
/* check for exponent sign */ |
| 377 |
if (s[i] == 45) /* 45 is '-' */ |
| 378 |
{ |
| 379 |
expsign = 1; /* flag negative exponent */ |
| 380 |
i++; /* point to next */ |
| 381 |
} |
| 382 |
else if (s[i] == 43) /* 43 is '+' */ |
| 383 |
i++; /* point to next */ |
| 384 |
|
| 385 |
/* now get exponent */ |
| 386 |
while (_isdigit(s[i])) |
| 387 |
{ |
| 388 |
eexp = eexp*10 + s[i] - 48; /* 48 is '0' */ |
| 389 |
i++; /* point to next */ |
| 390 |
} |
| 391 |
|
| 392 |
/* adjust exponent sign */ |
| 393 |
if (expsign) |
| 394 |
eexp = -eexp; /* make it negative */ |
| 395 |
} |
| 396 |
|
| 397 |
/* compute absolute value of final float */ |
| 398 |
exp0 += eexp; |
| 399 |
while (exp0 < 0) /* for negative exponents */ |
| 400 |
{ |
| 401 |
m = m / 10.0; |
| 402 |
exp0++; |
| 403 |
} |
| 404 |
while (exp0 > 0) /* for positive exponents */ |
| 405 |
{ |
| 406 |
m = m * 10.0; |
| 407 |
exp0--; |
| 408 |
} |
| 409 |
|
| 410 |
/* adjust final float sign from mantissa */ |
| 411 |
if (sign) |
| 412 |
return (-m); /* negative */ |
| 413 |
else |
| 414 |
return (m); /* positive */ |
| 415 |
} |
| 416 |
|
| 417 |
void disable_pcode_serial() |
| 418 |
/* necessary to receive characters using serial_getchar */ |
| 419 |
{ |
| 420 |
poke(0x3c, 1); |
| 421 |
} |
| 422 |
|
| 423 |
void reenable_pcode_serial() |
| 424 |
/* necessary for IC to interact with board again */ |
| 425 |
{ |
| 426 |
poke(0x3c, 0); |
| 427 |
} |
| 428 |
|
| 429 |
/* |
| 430 |
====================================================================== |
| 431 |
For sending and receiving single bytes, you can use Randy's IC code: |
| 432 |
*/ |
| 433 |
|
| 434 |
void serial_putchar(int c) |
| 435 |
{ |
| 436 |
while (!(peek(0x102e) & 0x80)); /* wait until serial transmit empty |
| 437 |
*/ |
| 438 |
poke(0x102f, c); /* send character */ |
| 439 |
} |
| 440 |
|
| 441 |
int serial_getchar() |
| 442 |
{ |
| 443 |
while (!(peek(0x102e) & 0x20)); /* wait for received character */ |
| 444 |
return peek(0x102f); |
| 445 |
} |
| 446 |
|
| 447 |
void main(void) { |
| 448 |
int pos, c = ' ', var1, var2; |
| 449 |
float f1, f2; |
| 450 |
char buffer[80]; |
| 451 |
disable_pcode_serial(); |
| 452 |
beep(); |
| 453 |
printf("\nSerial IO Mode!"); |
| 454 |
printf("Listening..."); |
| 455 |
msleep(500L); |
| 456 |
while (c != 'q') { |
| 457 |
c = serial_getchar(); |
| 458 |
/* printf("[%d] ", c); */ |
| 459 |
if (c == MOTOR) { |
| 460 |
var1 = serial_getchar(); |
| 461 |
var2 = serial_getchar() - 100; |
| 462 |
motor(var1, var2); |
| 463 |
} else if (c == AO) { |
| 464 |
ao(); |
| 465 |
} else if (c == ANALOG) { |
| 466 |
var1 = serial_getchar(); |
| 467 |
serial_putchar(analog(var1)); |
| 468 |
} else if (c == DIGITAL) { |
| 469 |
var1 = serial_getchar(); |
| 470 |
serial_putchar(digital(var1)); |
| 471 |
} else if (c == PRINTF) { |
| 472 |
pos = 0; |
| 473 |
while (c != 0) { |
| 474 |
buffer[pos++] = c; |
| 475 |
c = serial_getchar(); |
| 476 |
} |
| 477 |
buffer[pos] = '\0'; |
| 478 |
printf(buffer); |
| 479 |
} else if (c == TONE) { |
| 480 |
pos = 0; |
| 481 |
c = serial_getchar(); |
| 482 |
while (c != 0) { |
| 483 |
buffer[pos++] = c; |
| 484 |
c = serial_getchar(); |
| 485 |
} |
| 486 |
buffer[pos] = '\0'; |
| 487 |
f1 = atof(buffer); |
| 488 |
pos = 0; |
| 489 |
c = serial_getchar(); |
| 490 |
while (c != 0) { |
| 491 |
buffer[pos++] = c; |
| 492 |
c = serial_getchar(); |
| 493 |
} |
| 494 |
buffer[pos] = '\0'; |
| 495 |
f2 = atof(buffer); |
| 496 |
tone(f1, f2); |
| 497 |
} else if (c == START_BUTTON) { |
| 498 |
serial_putchar(start_button()); |
| 499 |
} else if (c == STOP_BUTTON) { |
| 500 |
serial_putchar(stop_button()); |
| 501 |
} else if (c == BEEP) { |
| 502 |
beep(); |
| 503 |
} else if (c == KNOB) { |
| 504 |
serial_putchar(knob()); |
| 505 |
} |
| 506 |
} |
| 507 |
reenable_pcode_serial(); |
| 508 |
printf("\nHB Mode!"); |
| 509 |
} |
| 510 |
|
| 511 |
//************** END: serial_HB.c |
| 512 |
|
| 513 |
From [email protected] Wed Jul 1 02:44:06 1998 |
| 514 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 515 |
id AA22669; Wed, 1 Jul 1998 02:44:06 -0400 |
| 516 |
Received: from mail3.sirius.com (mail3.sirius.com [205.134.253.133]) |
| 517 |
by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id CAA13214 |
| 518 |
for <[email protected]>; Wed, 1 Jul 1998 02:01:55 -0400 (EDT) |
| 519 |
Received: from edsinger (ppp-asfm03--126.sirius.net [205.134.240.126]) |
| 520 |
by mail3.sirius.com (8.8.7/Sirius-8.8.7-97.08.12) with ESMTP id XAA26862 |
| 521 |
for <[email protected]>; Tue, 30 Jun 1998 23:01:54 -0700 (PDT) |
| 522 |
Message-Id: <[email protected]> |
| 523 |
From: "Aaron Edsinger" <[email protected]> |
| 524 |
To: "handy" <[email protected]> |
| 525 |
Subject: Serial Interface |
| 526 |
Date: Wed, 1 Jul 1998 02:06:39 +0100 |
| 527 |
X-Msmail-Priority: Normal |
| 528 |
X-Priority: 3 |
| 529 |
X-Mailer: Microsoft Internet Mail 4.70.1162 |
| 530 |
Mime-Version: 1.0 |
| 531 |
Content-Type: text/plain; charset=ISO-8859-1 |
| 532 |
Content-Transfer-Encoding: 7bit |
| 533 |
|
| 534 |
Hello, |
| 535 |
I've been having some problems using my HandyBoard to talk directly to my |
| 536 |
PC via the serial interface. I disable Interactive C and then Poke() and |
| 537 |
Peek() as has been described on this list. I send short character strings |
| 538 |
from my PC to the HandyBoard under Windows 95. If I send strings longer |
| 539 |
than 2 characters, it seems that some of the characters get lost. This |
| 540 |
behavior seems to be affected by repositioning or slightly modifying the |
| 541 |
code, suggesting perhaps a timing issue. |
| 542 |
|
| 543 |
Why might this be? Is there any way to check for an error situation? |
| 544 |
|
| 545 |
Thanks for any help, |
| 546 |
Aaron |
| 547 |
From [email protected] Thu Jul 16 03:13:49 1998 |
| 548 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 549 |
id AA23518; Thu, 16 Jul 1998 03:13:49 -0400 |
| 550 |
Received: from hq.freegate.com ([208.226.86.1]) |
| 551 |
by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id CAA18991 |
| 552 |
for <[email protected]>; Thu, 16 Jul 1998 02:17:47 -0400 (EDT) |
| 553 |
Received: (qmail+freegate 6968 invoked by alias); 16 Jul 1998 06:17:38 -0000 |
| 554 |
Received: from dialip-04.hq.freegate.com (HELO freegate.com) (208.226.86.222) |
| 555 |
by hq.freegate.com with SMTP; 16 Jul 1998 06:17:38 -0000 |
| 556 |
Message-Id: <[email protected]> |
| 557 |
Date: Wed, 15 Jul 1998 23:21:14 -0700 |
| 558 |
From: Chuck McManis <[email protected]> |
| 559 |
Reply-To: [email protected] |
| 560 |
Organization: Freegate Corporation |
| 561 |
X-Mailer: Mozilla 4.04 [en] (Win95; I) |
| 562 |
Mime-Version: 1.0 |
| 563 |
To: David Rye <[email protected]> |
| 564 |
Cc: [email protected] |
| 565 |
Subject: Re: Handyboard/RWP without p-code |
| 566 |
References: <[email protected]> |
| 567 |
Content-Type: text/plain; charset=us-ascii |
| 568 |
Content-Transfer-Encoding: 7bit |
| 569 |
|
| 570 |
Get a copy of icc11 v5.0 or later (from www.imagecraft.com) and use the |
| 571 |
handyboard library from their site. |
| 572 |
|
| 573 |
--Chuck |
| 574 |
|
| 575 |
From [email protected] Wed Jul 1 05:33:51 1998 |
| 576 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 577 |
id AA20653; Wed, 1 Jul 1998 05:33:51 -0400 |
| 578 |
Received: from alpha.delta.edu (alpha.delta.edu [161.133.129.3]) |
| 579 |
by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id EAA12514 |
| 580 |
for <[email protected]>; Wed, 1 Jul 1998 04:41:22 -0400 (EDT) |
| 581 |
Received: from pm295-18.dialip.mich.net by alpha.delta.edu; (5.65v3.0/1.1.8.2/06Jan97-0932AM) |
| 582 |
id AA31111; Wed, 1 Jul 1998 04:44:45 -0400 |
| 583 |
Received: from kott.my.domain ([email protected] [192.168.0.1]) |
| 584 |
by kott.my.domain (8.8.8/8.8.5) with SMTP id WAA20239; |
| 585 |
Tue, 30 Jun 1998 22:34:32 -0400 (EDT) |
| 586 |
Date: Tue, 30 Jun 1998 22:34:31 -0400 (EDT) |
| 587 |
From: David Kott <[email protected]> |
| 588 |
Sender: [email protected] |
| 589 |
To: [email protected] |
| 590 |
Cc: [email protected] |
| 591 |
Subject: Re: microcontroller |
| 592 |
In-Reply-To: <[email protected]> |
| 593 |
Message-Id: <[email protected]> |
| 594 |
Mime-Version: 1.0 |
| 595 |
Content-Type: TEXT/PLAIN; charset=US-ASCII |
| 596 |
|
| 597 |
On Mon, 29 Jun 1998 [email protected] wrote: |
| 598 |
|
| 599 |
> -I'd like to say thanks to all the folks who replied |
| 600 |
> to my question on the microcontroller speeds. |
| 601 |
> |
| 602 |
> Here's another general question about them though. |
| 603 |
> Should any unused pins be left open or should they |
| 604 |
> be grounded? |
| 605 |
> |
| 606 |
|
| 607 |
Eeeeeeeeeeek! Outputs left floating, CMOS inputs taken to ground with a |
| 608 |
4.7K resistor... presuming, of course, that a Logic 0 on that input won't |
| 609 |
generate adverse effects, e.g. a grounded active low interrupt line |
| 610 |
might be a problem. Such inputs should be taken to +5 with a 4.7K |
| 611 |
resistor. |
| 612 |
|
| 613 |
Floating CMOS inputs have a tendency to oscillate with the merest whisper |
| 614 |
of a voltage. |
| 615 |
|
| 616 |
TTL inputs may be left floating. |
| 617 |
|
| 618 |
Driving an output externally will just heat up your CPU.. or worse. |
| 619 |
|
| 620 |
-d |
| 621 |
|
| 622 |
-- |
| 623 |
The box said "Requires Windows 95/NT or better"... |
| 624 |
So I got Unix. |
| 625 |
|
| 626 |
Free the Source. Free your Computer... http://www.FreeBSD.org |
| 627 |
http://www.NetBSD.org |
| 628 |
http://www.OpenBSD.org |
| 629 |
|
| 630 |
From [email protected] Sun Mar 22 01:52:45 1998 |
| 631 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 632 |
id AA06355; Sun, 22 Mar 1998 01:52:45 -0500 |
| 633 |
Received: from cyber.sfgate.com (cyber.sfgate.com [198.93.154.11]) |
| 634 |
by aleve.media.mit.edu (8.8.7/ML970927) with SMTP id BAA23676 |
| 635 |
for <[email protected]>; Sun, 22 Mar 1998 01:08:09 -0500 (EST) |
| 636 |
Received: from localhost by cyber.sfgate.com with smtp |
| 637 |
(Smail3.2 #1) id m0yGduz-000Is1C; Sat, 21 Mar 1998 22:07:37 -0800 (PST) |
| 638 |
Date: Sat, 21 Mar 1998 22:07:37 -0800 (PST) |
| 639 |
From: Richard <[email protected]> |
| 640 |
X-Sender: rshirk@cyber |
| 641 |
To: [email protected] |
| 642 |
Subject: Frob nobs and IR |
| 643 |
Message-Id: <Pine.SOL.3.96.980321212443.21628C-200000@cyber> |
| 644 |
Mime-Version: 1.0 |
| 645 |
Content-Type: MULTIPART/MIXED; BOUNDARY="-559023410-1804928587-890546857=:21628" |
| 646 |
|
| 647 |
This message is in MIME format. The first part should be readable text, |
| 648 |
while the remaining parts are likely unreadable without MIME-aware tools. |
| 649 |
Send mail to [email protected] for more info. |
| 650 |
|
| 651 |
---559023410-1804928587-890546857=:21628 |
| 652 |
Content-Type: TEXT/PLAIN; charset=US-ASCII |
| 653 |
|
| 654 |
OK...Im now pretty happy with states of things but I still have a few |
| 655 |
questions I hope you can help me answer. The code attached works and |
| 656 |
everything, but only when i take the bit about playing the songs out. |
| 657 |
|
| 658 |
problem 1) |
| 659 |
It |
| 660 |
keeps saying that play is undefined. I saw that before and fixed it by |
| 661 |
changing the names of the labels of the songs. I tried it this time and |
| 662 |
it didnt work...i was wondering if anyone out there knows why it does this |
| 663 |
and how to correct it.... |
| 664 |
|
| 665 |
problem 2) |
| 666 |
|
| 667 |
I figured out (thanks to you guys) how to work the built in IR sensor to |
| 668 |
detect and act upon 4 signals. One is for behing hostile, 3 is for |
| 669 |
seeking, signal 5 is when it gets annoyed, and 7 it just beeps and ignores |
| 670 |
it. |
| 671 |
The signal for being Hostile responds quickly and prints H on the screen |
| 672 |
but the others lag and i was wondering if you knew why this was. |
| 673 |
|
| 674 |
-Richard |
| 675 |
|
| 676 |
---559023410-1804928587-890546857=:21628 |
| 677 |
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="xbump2.c" |
| 678 |
Content-Transfer-Encoding: BASE64 |
| 679 |
Content-ID: <Pine.SOL.3.96.980321220737.21628D@cyber> |
| 680 |
Content-Description: |
| 681 |
|
| 682 |
LyogVGhpcyBpcyAoc2xpZ2h0bHkgbW9kaWZpZWQpIGRlZmF1bHQgdG91Y2gg |
| 683 |
bmF2aWdhdGlvbiAqLw0gICAgICAgICBjaGFyIHBuX3NvbmdbXT0gIjEjZCA0 |
| 684 |
ZTNyMSNmNGczcjEjZCAzZTEjZjNnMWMzYkQxZTNnMWIgOCZiMmIyYTJnMmUy |
| 685 |
ZDEwZSAgICAgIDdyMSNkIDRlM3IxI2Y0ZzNyMSNkIDNlMSNmM2cxYzNiMWcz |
| 686 |
YjFlIDI4JmUgRDNyMSNkIDRlM3IxI2Y0ZzNyMSNkICAgICAgM2UxI2YzZzFj |
| 687 |
M2JEMWUzZzFiIDgmYjJiMmEyZzJlMmQxMGUgMTJyIFUzZTFkM2IxYTNnMSNm |
| 688 |
ICAgICAgMSZiM2ExJmIzYTEmYjNhMSZiM2EgMmcyZTJkMjBlIjsNDSAgY2hh |
| 689 |
ciBsdHVuZV9zb25nW109ICJVM2UxZDJjMmQyZTJkMmUyYzJkMmQyZDZkMnIg |
| 690 |
M2QxYzJiMmMyZDIjYzJkMmIyYzJjMmM2YyI7DQ0Ndm9pZCBtYWluKCApDXsN |
| 691 |
ICAgLyogdGltaW5nIHBhcmFtZXRlcnMgKG1pbGxpc2Vjb25kcykgKi8NICAg |
| 692 |
bG9uZyByZXZlcnNlX3RpbWUgPSA1MDBMLCB0dXJuX3RpbWUgPSA1MDBMLCB0 |
| 693 |
dXJuYXJvdW5kX3RpbWUgPSAxMDAwTDsNICAgIHNvbnlfaW5pdCAoMSk7DSAg |
| 694 |
ICBwcmludGYoIkF1dG9ub21vdXNcbiIpOw0gICAgbXNsZWVwKDUwMEwpOw0g |
| 695 |
ICAgcHJpbnRmKCJSb2JvdGljXG4iKTsNICAgIG1zbGVlcCg1MDBMKTsNICAg |
| 696 |
IHByaW50ZigiTmF2aWdhdGlvblxuIik7DSAgICBtc2xlZXAoNTAwTCk7DSAg |
| 697 |
ICB7DSAgICAgICAgIGlmICgoIGtub2IoICkgKSA9PSAyNTUpDSAgICAgICAg |
| 698 |
IHsNICAgICAgICAgICAgICAgcGxheSAocG5fc29uZyk7DSAgICAgICAgICB9 |
| 699 |
DSAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9PSAwKQ0gICAgICAg |
| 700 |
ICAgew0gICAgICAgICAgICAgICAgcGxheSAobHR1bmVfc29uZyk7DSAgICAg |
| 701 |
ICAgICB9DSAgICAgICAgICAgICAgICBlbHNlIGlmICgoIGtub2IoICkgKSA9 |
| 702 |
PSAxMTYpDSAgICAgICAgICB7DSAgICAgICAgICAgICAgICBwcmludGYoIkhF |
| 703 |
TExPLCBKVURHRVMhXG4iKTsNICAgICAgICAgICAgICAgIG1zbGVlcCg1MDBM |
| 704 |
KTsNICAgICAgICAgIH0NICAgIH0NDSAgIHByaW50ZiggIlByZXNzIFNUQVJU |
| 705 |
XG4iICk7DSAgIHN0YXJ0X3ByZXNzKCk7ICAgLyogd2FpdCAndGlsIGJ1dHRv |
| 706 |
biBpcyBwcmVzc2VkICovDSAgIGJlZXAoKTsNICAgcHJpbnRmKCAiU3RhbmQg |
| 707 |
YmFjay4uLlxuIiApOw0gICBzbGVlcCggMS4wICk7IA0gICAvKiBpbml0aWF0 |
| 708 |
ZSBmb3J3YXJkIG1vdGlvbiAqLw0gICBmZCggMiApOw0gICBmZCggMyApOw0g |
| 709 |
ICB3aGlsZSggMSApICAgLyogZmVlZGJhY2sgbG9vcCAqLw0gICB7DSAgICAg |
| 710 |
IGlmKCAhIGRpZ2l0YWwoIDcgKSApICAgLyogY2hlY2sgbGVmdCBidW1wZXIg |
| 711 |
Ki8NICAgICAgew0gICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJl |
| 712 |
ZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAg |
| 713 |
ICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUgKTsNDSAgICAgICAgIC8qIHR1 |
| 714 |
cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMg |
| 715 |
KTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNDSAgICAgICAgIC8q |
| 716 |
IHJlc2V0IGZvcndhcmQgbW90aW9uICovDSAgICAgICAgIHByaW50ZiggIjAi |
| 717 |
ICk7DSAgICAgICAgIGZkKCAyICk7DSAgICAgICAgIGZkKCAzICk7DQ0gICAg |
| 718 |
ICB9DQ0gICAgICBlbHNlIGlmKCAhIGRpZ2l0YWwoIDExICkgKSAgIC8qIGNo |
| 719 |
ZWNrIG1pZGRsZSBidW1wZXIgKi8NICAgICAgew0gICAgICAgICAvKiByZXZl |
| 720 |
cnNlICovDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmsoIDIgKTsNICAg |
| 721 |
ICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCByZXZlcnNlX3RpbWUg |
| 722 |
KTsNDSAgICAgICAgIC8qIHR1cm4gYXJvdW5kICovDSAgICAgICAgIGZkKCAy |
| 723 |
ICk7DSAgICAgICAgIGJrKCAzICk7DSAgICAgICAgIG1zbGVlcCggdHVybmFy |
| 724 |
b3VuZF90aW1lICk7DQ0gICAgICAgICAvKiByZXNldCBmb3J3YXJkIG1vdGlv |
| 725 |
biAqLw0gICAgICAgICBwcmludGYoICIxIiApOw0gICAgICAgICBmZCggMiAp |
| 726 |
Ow0gICAgICAgICBmZCggMyApOw0gICAgICB9DQ0gICAgICBlbHNlIGlmKCAh |
| 727 |
IGRpZ2l0YWwoIDE1ICkgKSAgIC8qIGNoZWNrIHJpZ2h0IGJ1bXBlciAqLw0g |
| 728 |
ICAgICB7DSAgICAgICAgIC8qIHJldmVyc2UgKi8NICAgICAgICAgYmVlcCgp |
| 729 |
Ow0gICAgICAgICBiayggMiApOw0gICAgICAgICBiayggMyApOw0gICAgICAg |
| 730 |
ICBtc2xlZXAoIHJldmVyc2VfdGltZSApOw0NICAgICAgICAgLyogdHVybiBs |
| 731 |
ZWZ0ICovDSAgICAgICAgIGJrKCAyICk7DSAgICAgICAgIGZkKCAzICk7DSAg |
| 732 |
ICAgICAgIG1zbGVlcCggdHVybl90aW1lICk7DQ0gICAgICAgICAvKiByZXNl |
| 733 |
dCBmb3J3YXJkIG1vdGlvbiAqLw0gICAgICAgICBwcmludGYoICIyIiApOw0g |
| 734 |
ICAgICAgICBmZCggMiApOw0gICAgICAgICBmZCggMyApOw0gICAgIH0NICAg |
| 735 |
ICBlbHNlIGlmKGlyX2RhdGEoIDAgKSA9PSAxMjggKSAvKkNoZWNrIElSIHJl |
| 736 |
Y2lldmVyKi8NICAgICAgew0gICAgICAgICAgcHJpbnRmKCJIIik7DSAgICAg |
| 737 |
ICAgIC8qIHR1cm4gcmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAg |
| 738 |
ICAgYmsoIDMgKTsNICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAg |
| 739 |
ICAgICAgIC8qQXR0YWNrLi4uUm9ib3QgaXMgSG9zdGlsZSAqLw0gICAgICAg |
| 740 |
ICAgYmVlcCgpOyANICAgICAgICAgIGZkKCAyICk7DSAgICAgICAgICBmZCgg |
| 741 |
MyApOw0gICAgICAgICAgYmVlcCgpOw0gICAgIH0NICAgICBlbHNlIGlmKGly |
| 742 |
X2RhdGEoIDAgKSA9PSAxMzAgKSAvKkNoZWNrIElSIHJlY2lldmVyKi8NICAg |
| 743 |
ICAgew0gICAgICAgICAgcHJpbnRmKCJTIik7DSAgICAgICAgIC8qIHR1cm4g |
| 744 |
cmlnaHQgKi8NICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgYmsoIDMgKTsN |
| 745 |
ICAgICAgICAgbXNsZWVwKCB0dXJuX3RpbWUgKTsNICAgICAgICAgIC8qUm9i |
| 746 |
b3QgaXMgaW4gbG92ZSEgRG8gYSBsaWwgZGFuY2UhICovDSAgICAgICAgICBi |
| 747 |
ZWVwKCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgZmQoIDIgKTsN |
| 748 |
ICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBtc2xlZXAoIHR1cm5fdGlt |
| 749 |
ZSApOw0gICAgICAgICAgYmsoIDIgKTsNICAgICAgICAgIGJrKCAzICk7DSAg |
| 750 |
ICAgICAgICBtc2xlZXAoIHJldmVyc2VfdGltZSApOyANICAgICAgICAgIC8q |
| 751 |
R28gZm9yd2FyZCEqLw0gICAgICAgICAgZmQoIDIgKTsNICAgICAgICAgIGZk |
| 752 |
KCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7DSAg |
| 753 |
ICAgfQ0gICAgIGVsc2UgaWYoaXJfZGF0YSggMCApID09IDEzMiApIC8qQ2hl |
| 754 |
Y2sgSVIgcmVjaWV2ZXIqLw0gICAgICB7DSAgICAgICAgICBwcmludGYoIkEi |
| 755 |
KTsNICAgICAgICAvKiByZXZlcnNlICovDSAgICAgICAgIGJlZXAoKTsNICAg |
| 756 |
ICAgICAgYmsoIDIgKTsNICAgICAgICAgYmsoIDMgKTsNICAgICAgICAgbXNs |
| 757 |
ZWVwKCByZXZlcnNlX3RpbWUgKTsNICAgICAgICAgIC8qUm9ib3QgaXMgQW5u |
| 758 |
b3llZCEgVHVybnMgY29tcGxldGVseSBhcm91bmQgaW4gZGlndXN0Ki8gICAg |
| 759 |
ICAgDSAgICAgICAgIGJlZXAoKTsNICAgICAgICAgYmVlcCgpOyANICAgICAg |
| 760 |
ICAgYmVlcCgpOw0gICAgICAgICBmZCggMiApOw0gICAgICAgICBiayggMyAp |
| 761 |
Ow0gICAgICAgICBtc2xlZXAoIHR1cm5hcm91bmRfdGltZSApOw0gICAgICAg |
| 762 |
ICAgZmQoIDIgKTsNICAgICAgICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVw |
| 763 |
KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0NICAg |
| 764 |
ICB9DSAgICAgZWxzZSBpZihpcl9kYXRhKCAwICkgPT0gMTM0ICkgLypDaGVj |
| 765 |
ayBJUiByZWNpZXZlciovDSAgICAgIHsNICAgICAgICAgIHByaW50ZigiSSIp |
| 766 |
Ow0gICAgICAgICAgLypSb2JvdCBkb2Vzbid0IGNhcmUgKi8NICAgICAgICAg |
| 767 |
IGJlZXAoKTsgDSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVwKCk7 |
| 768 |
IA0gICAgICAgICAgYmVlcCgpOw0gICAgICAgICAgZmQoIDIgKTsNICAgICAg |
| 769 |
ICAgIGZkKCAzICk7DSAgICAgICAgICBiZWVwKCk7DSAgICAgICAgICBiZWVw |
| 770 |
KCk7DSAgICAgICAgICBiZWVwKCk7IA0gICAgICAgICAgYmVlcCgpOw0gDSAg |
| 771 |
ICB9DQ0gICB9DX0N |
| 772 |
---559023410-1804928587-890546857=:21628-- |
| 773 |
|
| 774 |
From [email protected] Mon Jul 6 11:54:19 1998 |
| 775 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 776 |
id AA03667; Mon, 6 Jul 1998 11:54:19 -0400 |
| 777 |
Received: from web04.globecomm.net (web04.globecomm.net [207.51.48.104]) |
| 778 |
by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id TAA30534 |
| 779 |
for <[email protected]>; Mon, 6 Jul 1998 19:24:28 -0400 (EDT) |
| 780 |
From: [email protected] |
| 781 |
Received: (from root@localhost) by web04.globecomm.net (8.8.8/8.8.0) id TAA03097; Mon, 6 Jul 1998 11:24:27 -0400 (EDT) |
| 782 |
Date: Mon, 6 Jul 1998 11:24:27 -0400 (EDT) |
| 783 |
Message-Id: <[email protected]> |
| 784 |
Content-Type: multipart/mixed; boundary="0-0-0-0-0-0-0-0-____====$%&" |
| 785 |
Mime-Version: 1.0 |
| 786 |
To: Terri A Mortvedt <[email protected]>, [email protected] |
| 787 |
Subject: Re: Steppers |
| 788 |
|
| 789 |
--0-0-0-0-0-0-0-0-____====$%& |
| 790 |
Content-Type: text/plain |
| 791 |
Content-Transfer-Encoding: quoted-printable |
| 792 |
X-MIME-Autoconverted: from 8bit to quoted-printable by aleve.media.mit.edu id TAA30534 |
| 793 |
|
| 794 |
Dear Terri, |
| 795 |
|
| 796 |
If the motors turn sparatically, that means the coils |
| 797 |
are probably not hooked up in the correct order. Try |
| 798 |
swapping them around and see if anything improves. |
| 799 |
|
| 800 |
The motors you are using are the bipolar type. There=20 |
| 801 |
is a decent way of hooking up unipolar steppers to |
| 802 |
the HB at http://www.cctc.demon.co.uk/stepper.htm |
| 803 |
A basic difference between bipolar and unipolar is |
| 804 |
that unipolar motors have additional wires are=20 |
| 805 |
connected to the power supply. Bipolars also have more |
| 806 |
torque. |
| 807 |
|
| 808 |
Using fd(); and bk(); commands to power steppers is |
| 809 |
probably a lot to handle. I recommend trying the=20 |
| 810 |
method found on that link. There's even sample coding. |
| 811 |
You will have to modify some variables for the turn |
| 812 |
functions because your turning radius varies according |
| 813 |
to your distance between motors. |
| 814 |
|
| 815 |
I modified the step(); function to produce a gradual=20 |
| 816 |
increase in speed, and a gradual decrease in speed once |
| 817 |
the specified steps are almost complete.=20 |
| 818 |
|
| 819 |
I will attach my motors.c file as is. |
| 820 |
|
| 821 |
|
| 822 |
|
| 823 |
_________________________________________________ |
| 824 |
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= |
| 825 |
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF |
| 826 |
Brian Carvalho [ [email protected] ] |
| 827 |
DeVRY Institute |
| 828 |
New Jersey |
| 829 |
_________________________________________________ |
| 830 |
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= |
| 831 |
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF |
| 832 |
--------------------------------------------------- |
| 833 |
Get free personalized email at http://www.iname.com |
| 834 |
|
| 835 |
--0-0-0-0-0-0-0-0-____====$%& |
| 836 |
Content-Type: application/octet-stream |
| 837 |
Content-disposition: inline; filename=Motors.c |
| 838 |
Content-Transfer-Encoding: base64 |
| 839 |
|
| 840 |
|
| 841 |
|
| 842 |
LyogTW90b3JzLmMgKi8NCg0KLyoqKiBERUNMQVJBVElPTlMgKioqLw0KDQppbnQgRk9SV0FSRFMg |
| 843 |
PSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB2YXJpYWJsZXMgZm9yIGRpcmVj |
| 844 |
dGlvbiAqLw0KaW50IEJBQ0tXQVJEUyA9IDE7DQogDQppbnQgSEFMRlRVUk4gPSA3MDsgICAgICAg |
| 845 |
ICAgICAgICAgICAgICAgICAgICAgIC8qIHZhcmlhYmxlcyBmb3IgdHVybmluZyAqLw0KaW50IFFV |
| 846 |
QVJURVJUVVJOID0gSEFMRlRVUk4gLyAyOw0KIA0KaW50IFJJR0hUID0gMjsgICAgICAgICAgICAg |
| 847 |
ICAgICAgICAgICAgICAgICAgICAgLyogdmFsdWVzIGZvciB0dXJucyAqLw0KaW50IExFRlQgPSA4 |
| 848 |
Ow0KDQppbnQgcmlnaHRfbW90b3JfcG9pbnRlciA9IDA7ICAgICAgICAgICAgICAgICAgICAvKiBt |
| 849 |
b3RvciBjb250cm9sIHZhbHVlcyAqLw0KaW50IGxlZnRfbW90b3JfcG9pbnRlciA9IDA7DQogDQog |
| 850 |
DQppbnQgY3ljbGVfbGVuZ3RoID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBoYWxm |
| 851 |
IHN0ZXBwaW5nIHZhbHVlcyAqLw0KaW50IGxlZnRfc3RlcF90YWJsZVs0XSA9IHs0OCw0OSw1MSw1 |
| 852 |
MH07DQppbnQgcmlnaHRfc3RlcF90YWJsZVs0XSA9IHsxOTIsMTk2LDIwNCwyMDB9Ow0KDQpsb25n |
| 853 |
IFNMT1cgPSAyNUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbWlsbGlzZWNv |
| 854 |
bmQgcGF1c2VzICovDQpsb25nIEZBU1QgPSA4TDsNCg0KLyoqKiBGVU5DVElPTlMgKioqLw0KDQoN |
| 855 |
CnZvaWQgc2V0ZmFzdChsb25nIEYpDQp7DQoJCQlGQVNUID0gRjsNCn0NCg0Kdm9pZCBzZXRzbG93 |
| 856 |
KGxvbmcgUykNCnsNCgkJCVNMT1cgPSBTOw0KfQ0KDQoNCnZvaWQgc3RlcHBlcnNfb3V0KHZvaWQp |
| 857 |
DQp7DQoJCQlpbnQgY29udHJvbF9ieXRlID0gMDsNCgkJCWNvbnRyb2xfYnl0ZSArPSBsZWZ0X3N0 |
| 858 |
ZXBfdGFibGVbbGVmdF9tb3Rvcl9wb2ludGVyXTsNCgkJCWNvbnRyb2x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hZCk7DQoJCWxlZnRfc3RlcChk |
| 897 |
aXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51ZT1z |
| 898 |
dGVwOw0KICAgICAgICAgICAgICAgIGdyYWQ9Z3JhZC0xTDsNCg0KCX0NCiAgICAgICAgd2hpbGUo |
| 899 |
Y29udGludWU8YmVnaW4qOSkNCgl7DQoJCW1zbGVlcCgobG9uZylkZWxheSk7DQoJCWxlZnRfc3Rl |
| 900 |
cChkaXIpOw0KCQlyaWdodF9zdGVwKGRpcik7DQoJCXN0ZXBwZXJzX291dCgpOw0KCQljb250aW51 |
| 901 |
ZSsrOw0KICAgICAgICAgICAgICAgIHN0cD1jb250aW51ZTsNCgkgfQ0KDQogICAgICAgICB3aGls |
| 902 |
ZShzdHA8bnVtc3RlcHMpDQogICAgICAgICB7DQogICAgICAgICAgICAgIGRlbGF5PWRlbGF5KzE7 |
| 903 |
DQogICAgICAgICAgICAgIG1zbGVlcCgobG9uZylkZWxheSk7DQogICAgICAgICAgICAgIGxlZnRf |
| 904 |
c3RlcChkaXIpOw0KICAgICAgICAgICAgICByaWdodF9zdGVwKGRpcik7DQogICAgICAgICAgICAg |
| 905 |
IHN0ZXBwZXJzX291dCgpOw0KICAgICAgICAgICAgICBzdHArKzsNCiAgICAgICAgIH0NCglhbygp |
| 906 |
Ow0KDQp9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCg0K |
| 907 |
|
| 908 |
|
| 909 |
--0-0-0-0-0-0-0-0-____====$%&-- |