Subject:
|
Expansion board test routine
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Mon, 15 Feb 1999 01:29:55 GMT
|
Original-From:
|
Duncan Orthner <orthner@idirect.=spamcake=com>
|
Viewed:
|
1347 times
|
| |
| |
Hello all,
Well here it is, for what it's worth. The functions are pretty
obvious, it works just like the original hbtest.c that Fred wrote. To try
servos other than #5, you'll have to edit the line:
servo5=(16*knob());
In the test_servo() routine.
Hope this helps, Duncan
expbtest.c
/*
test program for Handy Board
version 1.0 -- 26 nov 95
Fred G. Martin (fredm@media.mit.edu)
Modified 27 Jan 99 for testing
the expansion board inputs and
servo outputs by Duncan Orthner
(orthner@idirect.com)
*/
void
testmotors(void)
{
while (1) {
int i;
for (i= 0; i< 4; i++) {
fd(i); msleep(250L);
bk(i); msleep(250L);
off(i);
}
}
}
void
testdigitals(void)
{
printf("Press START ...\n");
while (peek(0x7fff)&0x80);
beep();
printf("Press STOP ...\n");
while (peek(0x7fff)&0x40);
beep();
while (1) {
int i;
printf("Digital inputs: ");
for (i=15; i>6; i--)
if (digital(i)) printf("1");
else printf("0");
printf("\n");
msleep(100L);
}
}
void
testanalogs_2to6(void)
{
printf("Press START to test knob...\n");
start_press();
while (1) {
printf("Turn knob; STOP to end -> %d\n", knob());
msleep(100L);
if (stop_button()) {
beep();
break;
}
}
printf("Press START for analog ins 2-6\n");
start_press();
while (1) {
int i;
for (i=6; i >=2; i--)
printf("%d ", analog(i));
printf("\n");
msleep(100L);
if (stop_button()) {
beep();
break;
}
}
printf("\n");
}
void
testanalogs_16to23(void)
{
printf("Press START for analogs 16-23\n");
start_press();
while (1) {
int i;
for (i=23;i>=16; i--)
printf("%d ", analog(i));
printf("\n");
msleep(100L);
if (stop_button()) {
beep();
break;
}
}
printf("\n");
}
void
testanalogs_24to31(void)
{
printf("Press START for analogs 24-31\n");
start_press();
while (1) {
int i;
for (i=31;i>=24; i--)
printf("%d ", analog(i));
printf("\n");
msleep(100L);
if (stop_button()) {
beep();
break;
}
}
printf("\n");
}
/*
adjusts the servo position with the knob
*/
void test_servo()
{
init_expbd_servos(1);
while(1){
printf("Press start to adjust servo...\n");
start_press();
printf("Stop to quit\n");
while(1) {
servo5=(16*knob());
if (stop_button()) {
beep();
break;
}
}
}
}
|
|
Message is in Reply To:
| | 68HC11 Emulator for Win-32
|
| The March, 1999 issue of Dr. Dobb's Journal has an article about WOOKIE, a windoze based emulator for 68HC11 software development. It looks interesting. The source and an executable are available as freeware from: (URL) - - - Nick - - - (26 years ago, 8-Feb-99, to lugnet.robotics.handyboard)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|