Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
Parallelput help? I'm kinda lost!
Author Message
NitzGuy

Posted: Tue Oct 21, 2003 10:06 am   Post subject: Parallelput help? I'm kinda lost!

Sup. What I have here is a student project for a grade 9 class (I do co-op and assist with teaching) and they are doing a project where they need to soldier together 2 logic gates and a 7 segment LED, and then interface it with the computer to get it to display stuff. So far, I have programming to display stuff, but only the numbers come out correctly on the display. I have come to the conclusion that what I need to do is make something that is like input A=parallelput(20) or like a better example, S = parallelput (21) (21 displays an s shape on the 7 segment LED). I am not an uber l337 turing programmer, and I could use some help here

This is the code I have so far, if someone could explain to me how to take an input and convert it to a number that parallelput could use, or just integrate it into my current code, it would be greatly aprecieated

 code: var name:string put "Enter your name" get name:* for counter:1 .. length(name)      put name (counter):8, ord(name(counter))      parallelput (ord(name(counter)))      delay (2000) end for

and that does display 0-9 correctly on the LED, but letters come out incomplete and jumbled. Thanks in Advanced, Nitz.

hackman

Posted: Tue Oct 21, 2003 10:54 am   Post subject: (No subject)

Just wanted to say, thats one hell of a grade 9 asignment. Im in grade 10 and i barely know what your talking about. Sorey I cant help ya.
Tony

Posted: Tue Oct 21, 2003 3:23 pm   Post subject: (No subject)

heh, grade 9s just solder the board and hook it up to the software writen in turing

Anyways, ord() converts a character to its ASCII value. I'm not sure how parallelput and LEDs work, but ASCII value of non numeric values might not neccesearly correspond to the values needed for parallelput.

The following program should shed some light on how parallelput displays values.
 code: for i:1..255      locate(1,1)      put "Now Displaying : " + chr(i)      parallelput (i)      delay (2000) end for

The computer screen will display all characters while LEDs will display whatever coresponds for that ASCII value. From there you can draw your own chart
Tony's programming blog. DWITE - a programming contest.
NitzGuy

Posted: Wed Oct 22, 2003 4:05 pm   Post subject: (No subject)

Thanks tony, ill give it a try on friday.

Yeah their grade 9's, its a general technology class, 3 parts I think, one doing computer and electronics, other doing auto, other doing machining and crap. For this project they have to find out IC pin outs and figure out what ICs they need depending on the logic gates we give them and then they make a diagram on how to connect it all and if it matches the master copy then we let them go at it, from there, they can make their own program or use the one I am attempting to make for them
Tony

Posted: Wed Oct 22, 2003 5:13 pm   Post subject: (No subject)

heh, if your students will be doing programming - tell them about compsci.ca We're always looking for new members to broaden the community.
Tony's programming blog. DWITE - a programming contest.
Rudiger

Posted: Wed Oct 22, 2003 7:46 pm   Post subject: (No subject)

ok what is IS and what are GATES and the other thing.....

Posted: Thu Oct 23, 2003 10:16 pm   Post subject: (No subject)

i learnt logic gates in grade 11... we did a unit on it... logic gates take in data and output it depending on which gate you use

of course there's more to it, but i didnt find them that interesting... so i slept most of the time... ok, well i slept all through that class.... was very boring, but i passed with a 94 cuz i did all the assignments

Posted: Fri Oct 24, 2003 12:15 am   Post subject: (No subject)

i learnt logic gates in grade 11... we did a unit on it... logic gates take in data and output it depending on which gate you use

of course there's more to it, but i didnt find them that interesting... so i slept most of the time... ok, well i slept all through that class.... was very boring, but i passed with a 94 cuz i did all the assignments

haha exactly like college actually the assignments and shit in high school were harder than college is

NitzGuy

Posted: Fri Oct 24, 2003 8:07 am   Post subject: (No subject)

NitzGuy

Posted: Fri Oct 24, 2003 8:32 am   Post subject: (No subject)

Ok that chart really lost me lol, I went through the whole list, but how can I set it for each letter that is inputted? I was playing with it
Tony

Posted: Fri Oct 24, 2003 9:13 am   Post subject: (No subject)

well if you have a list of values needed to be passed for each specific character, you can create an array 1..255, where index is the ASCII value of the character you're trying to output. Then will the array with appropriate values from the chart.
Tony's programming blog. DWITE - a programming contest.
NitzGuy

Posted: Mon Oct 27, 2003 9:57 am   Post subject: (No subject)

Ok I tried that again, let it go through. It's like "Now Displaying : A" and it displays a 1, and for B, it displays a 2, and so on. I'm still not getting how I can make it display letters correctly lol. By the way I'm no pro programmer, I never really bothered with it much. What I was thinking is like as far as I can think programming wise
 code: for A:parallelput(21)
and like
 code: for B:parallelput(22)
stuff like that. Im not sure, pop me some more examples or explinations please , I'm just alittle slow sometimes.
Tony

Posted: Mon Oct 27, 2003 6:06 pm   Post subject: (No subject)

ok, see... "Now Displaying : A" and it shows "1" means that ASCII does not correspond to values you need.

the value of
 code: ord("A")

produces 1.

Now you just have to wait untill your display board will show "A" and read the computer screen to see what value has been passed.

I think this program will help:

 code: var list:array 1..255 of int var letter:string(1) for i:1..255      parallelput (i)           locate(1,1)      put "What letter is displaying?"      getch(letter)      list(chr(letter)):=i end for

You just sit there, and type in whatever character has been displayed. Now all the values will be stores in array named "list" You might want to save that list in a file and import it in programs so you dont have to retype everything.

If I'm correct, then
 code: parallelput (list(ord("A"))

should display "A" on your LCD
Tony's programming blog. DWITE - a programming contest.
NitzGuy

Posted: Thu Oct 30, 2003 10:04 am   Post subject: (No subject)

Ok I'm getting 1 error when trying to run that program.
 code: list(chr(letter)):=i

Argument to 'chr' must be integer.

Help? lol.
Dan

Posted: Thu Oct 30, 2003 12:20 pm   Post subject: (No subject)

chr() only takes an int, you probly wont ord()
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 2  [ 18 Posts ]
Goto page 1, 2  Next
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: