View Single Post
  #9   Spotlight this post!  
Unread 07-12-2003, 15:35
Dave... Dave... is offline
Registered User
#0005 (Robocards)
 
Join Date: Aug 2001
Location: AFL/MHS Melvindale, MI
Posts: 64
Dave... will become famous soon enough
Re: EduBot and USART ports

Quote:
Originally Posted by Rickertsen2
anyway here ya go:
PHP Code:
/*******************************************************************************
* FILE NAME: sensors.c
*
* DESCRIPTION:
*  Contains routines to read DIRRS+ Sensors
*  
*  Function prototypes etc are in sensors.h
*
*  BY: James Rickertsen
*
*******************************************************************************/

#include <usart.h>
#include <stdlib.h>
#include "printf_lib.h"
#include "ifi_default.h"
#include "ifi_aliases.h"
#include "user_routines.h"
#include "ifi_utilities.h"
#include "sensors.h"

#define SENSOR_SIGNATURE 0b10101010 
James,
Thanks for the info, but it brings a few more questions. You've obviously used this code with the Edubot since you have references to "ifi_..." and "rc_dig...". Where exactly does this code belong? Do I copy it to the user_routines.c file or somewhere else? Also, you use the include directive for "sensors.h" but this doesn't seem to be in one of the directories with the Edubot sourcecode or /mcc18/h folder. If this is a separate header file, can you please post it as well?

The digital compass we are trying to use sends three bytes through the USART. Will these correspond to sensors[1], sensors[2] and sensors[3] directly, or is this just a coincidence?

Your help is appreciated.
__________________
"...don't worry about that mechanical problem, Dave can fix it in the programming..."