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

Username:   Password: 
 RegisterRegister   
 7 segment display
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
stas054




PostPosted: Thu Jun 11, 2009 3:29 pm   Post subject: 7 segment display

What is it you are trying to achieve?
Hello everyone, I am making a test program with ultiple choice questiongs that works from a joystick I made.


What is the problem you are having?
I am having a problem with programming 7 segment display, it supposed to work as a countdown from 9 to 0 but it just puts random numbers and I don't get how it works exactly, can somebody explain to me? or give me a sample code for countdown on 7 segment from 9 to 0 using parallelput?


Describe what you have tried to solve this problem
I tried pretty much everything I found even putting something like parallelput(22) and it actually gave me numbers but I don't get the pattern




Turing:


%display functions
%0
parallelput (1)
parallelput (2)
parallelput (4)
parallelput (16)
delay (1000)

%1
parallelput (2)
parallelput (4)
parallelput (16)
delay (1000)

%2
parallelput (1)
parallelput (4)
parallelput (16)
delay (1000)

%3
parallelput (4)
parallelput (16)
delay (1000)

%4
parallelput (1)
parallelput (2)
parallelput (16)
delay (1000)


%5
parallelput (2)
parallelput (16)
delay (1000)

%6
parallelput (1)
parallelput (16)
delay (1000)


%7
parallelput (16)
delay (1000)

%8
parallelput (1)
parallelput (2)
parallelput (4)
delay (1000)

%9
parallelput (2)
parallelput (4)
delay (1000)





Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Jun 11, 2009 3:39 pm   Post subject: RE:7 segment display

read the docs on parallelput. In brief, with parallelput(22), you are not putting 22, but the binary string that 22 represents 0010110 -- match up 7 bits to your 7 segments, and you should figure out the patterns that will draw digits on the screen.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
stas054




PostPosted: Thu Jun 11, 2009 3:53 pm   Post subject: Re: 7 segment display

I got it now... but... I am only using 4 outputs so that would be 0000 for 0 0001 for 1, 0010 for 2 and so on, but it doesnt seem to work =/
stas054




PostPosted: Thu Jun 11, 2009 3:54 pm   Post subject: Re: 7 segment display

I mean it works but I am getting random numbers not the ones I need
stas054




PostPosted: Thu Jun 11, 2009 4:09 pm   Post subject: Re: 7 segment display

this is what I did

Turing:
parallelput(6)
delay(1000)
parallelput(7)
delay(1000)
parallelput(8)
delay(1000)
parallelput(9)
delay(1000)
parallelput(10)
delay(1000)
parallelput(11)
delay(1000)
parallelput(12)
delay(1000)
parallelput(13)
delay(1000)
parallelput(14)
delay(1000)
parallelput(15)
delay(1000)


but it doesn't work properly =(
Tony




PostPosted: Thu Jun 11, 2009 4:18 pm   Post subject: RE:7 segment display

what do you mean it doesn't work properly? What do you expect to be the proper result, and how is the observed behaviour different?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
stas054




PostPosted: Thu Jun 11, 2009 4:21 pm   Post subject: Re: 7 segment display

well it starts with 9 and then it displays random parts of the 7 seg... I don't understand why it does that if I look at the theory I have done everything correctly...
stas054




PostPosted: Thu Jun 11, 2009 4:22 pm   Post subject: RE:7 segment display

i want it to count... 9...8...7...6...5...4...3...2...1...
Sponsor
Sponsor
Sponsor
sponsor
stas054




PostPosted: Thu Jun 11, 2009 4:28 pm   Post subject: RE:7 segment display

nvm I got it thanks xD
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  [ 9 Posts ]
Jump to:   


Style:  
Search: