May 18, 2024, 07:27:00 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Newbie here with Stupid Questions

Started by blakrapter, August 02, 2007, 06:02:55 PM

Previous topic - Next topic

blakrapter

August 02, 2007, 06:02:55 PM Last Edit: August 02, 2007, 06:06:54 PM by blakrapter
Hello everyone,

I am new here and new to programing in general.  I have played with the BS2 on a few occassions over the past few years, but probably no more than 5 or 6 hours combined.  Anyway, I am working on a project that needs a lot of inputs to control a lot of outputs.  So, I found a board for the BS2 that will give me the inputs I need and a serial out to the EFX DC-16.  I have figured out how to control the outputs, BUT, have done it by playing with the provided test code.  I need to know what all of the initial "stuff" is so I know what I need to put into my code.  I downloaded the test code for the BS2 http://www.efx-tek.com/downloads/dc-16_test.zip  Can someone please walk me through whats going on in the following sections:

1.  Constants
2.  Variables
3.  Initialization

Are these sections something I should just copy and paste into my code, or should they be simplified?  I don't have a clue whats going on, so I don't know what can/should be removed or added.

If it makes a difference, my controller board will have to ouput the serial signal from pin 15, not 0.  I think thats just a matter of changing the assignment in the I/O definitions though.

Any help will be greatly appreciated!  Thanks in advance!


<----------------------EDITED LATER-------------------------------------------------->
I forgot two things that I should have asked before.

1.  With the setup described above, do I need to change the ULN ICs?
2.  Should the jumper be in or out with the BS2 controlling the board?

Thanks!

JonnyMac

 >:( <Grouchy Guy Mode>

If you don't know what you're doing, what makes you think you can simplify a program written by a veteren (yours truly) who has 25 years of coding experience on a variety of processors?

;D <Fun Guy Mode -- Grouchy Guy Mode was just a gag>

Okay, we tend to write programs that:

1) work
2) are easy to understand
3) are easy to use and maintain

Part of that means that they are somewhat verbose.  All of our test programs have the unit identify its revision code; you probably don't need the rev code and can skip over that part.  Since you're using the BS2, go to our friends at Parallax and download a PDF version of a book called "StampWorks" -- written by, you guessed it, yours truly.  It will teach about constants and variables and initialization.  The "What's A Microcontroller?" book is good, too, though a tad long-winded.

Once you get some programming basics you'll be able to take the operation sections you need and use the DC-16 with success.   And we're always here to help, though you have to divulge details about your mysterious input device and what you want your program to do.
Jon McPhalen
EFX-TEK Hollywood Office