Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need help with parallelget.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Destro




PostPosted: Mon Oct 28, 2013 12:40 pm   Post subject: Need help with parallelget.

What is it you are trying to achieve?
<We have been assigned a project in which we have to use buttons on a bread board to make music play from Turing. We have 25 pin CPU wires to connect to the bread board.>

What is the problem you are having?



Describe what you have tried to solve this problem


Please specify what version of Turing you are using
<4.1.1>
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Mon Oct 28, 2013 1:54 pm   Post subject: RE:Need help with parallelget.

Well, hopefully you know how to tell Turing to make noise ("music" would be generous) with Music.Play .

Presumably, you'll connect your breadboard to the computer via parallel port. Then, in Turing, you can use PC.ParallelGet to read from the parallel port and turn that into music.

Start with just one pin connected to one wire connected to a single button. Try to write a program that will wait until one of the buttons is pressed and will play a tone when that button is pressed.

Once you have one tone, adding other tones / wires / buttons should be pretty easy.
Destro




PostPosted: Tue Oct 29, 2013 10:18 am   Post subject: RE:Need help with parallelget.

Sorry, I originally filled out the entire post, but I guess it wasn't submitted properly?


What is the problem you are having?
I do not know how to use the syntax in order to make parallelget work. I don't even have the slightest clue, since I am very new to turing.
The parallel port is: http://d4web.net/sths/TEJ/U04Interfacing/A02Input/images/pinout.gif

Describe what you have tried to solve this program?
Using the Turing Reference Manual, and the example provided (it didn't work for me). Asking my teacher (she was unsure herself Sad ).
I tried "if parallelget = __". I tried setting parallelget as a variable. I honestly have no clue.

The code was:
Turing:

const val : int := parallelget  % Read in the set of pin values
        put "Pin 10 is: ", (val div 64) mod 2
        put "Pin 11 is: ", (val div 128) mod 2
        put "Pin 12 is: ", (val div 32) mod 2
        put "Pin 13 is: ", (val div 16) mod 2
        put "Pin 15 is: ", (val div 8) mod 2





Alright, that is the rest of it. Thanks for the response DemonWasp, but I am still unsure on this. I know how Music.Play works as I have made a program which plays music by pressing keys on the keyboard. However, I have absolutely no idea on where to start with parallelget. If I had a proper example program using parallelget, I think I would be able to figure out how it works. Thanks again Smile
DemonWasp




PostPosted: Tue Oct 29, 2013 2:49 pm   Post subject: RE:Need help with parallelget.

That example should work. What error message are you getting? I need the exact error message.

Also, are you completely sure that the computer you're running this on even has a parallel port?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: