Go to Post Mmmmmmmm. Donuts! - Sean Schuff [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Spotlight this post!  
Unread 02-06-2002, 01:46
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
Actually, I've been thinking.... they give us control over one byte. That means we can send either 8 digital outputs to the dashboard, or one 0-255 output...

If the 0-255 method is done by having
bit 0 = 1
bit 1 = 2
bit 2 = 4
bit 3 = 8
bit 4 = 16
bit 5 = 32
bit 6 = 64
bit 7 = 128
then turning on/off the appropriate bits to get any number from 0-255 (1+2+4+8+16+32+64+128 = 255), couldn't this method also be used to get two numbers from 0-15? Meaning....
bit 0 = 1
bit 1 = 2
bit 2 = 4
bit 3 = 8
bit 4 = 1
bit 5 = 2
bit 6 = 4
bit 7 = 8
So, using this method, we could program the Robot Feedback byte to actually carry two PWM values, but just the PWM value ±16. Since the maximum value is 255, if we divide it by 16, we get a number between 0 and 15. Thus, we could send to a dashboard program approximately two PWM values.

Say the code outputs a value of, oh, 123 to a pwm. We can take 123 and divide it by 16. Since PBASIC doesn't handle decimals, the final result would be 7 (it's actually 7.6875). This number will always be between 0 and 15, so we could use bits 0 through 3 to 'encode' it (bit 0 - on; bit 1 - on; bit 2 - on; bit 3 - off; 1+2+3 = 7). The same could be used with bits 4-7.

In the end, the dashboard program would read the Robot Feedback (LED) byte and from it, decode two numbers between 0 and 15 - or, two PWM outputs to the nearest 16. Sure, it's not perfect, but it's an approximation of what your robot code is sending out to the PWM.

This method could also be used to transfer to a dashboard program an approximate PWM value AND 4 digital outputs.

You guys understand what I'm trying to say?
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies

Last edited by DanL : 02-06-2002 at 01:48.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a dashboard program Jeff_Rice Programming 18 04-05-2003 23:21
Anyone looking for more program space? archiver 2001 13 24-06-2002 02:20
Custom dashboard program available. Interest? archiver 2001 4 24-06-2002 00:45
miroboworks dashboard program? archiver 2000 3 23-06-2002 23:04
Yet another dashboard program Neal Probert Programming 3 12-05-2002 10:43


All times are GMT -5. The time now is 11:19.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi