is it possible to convert 16 switches to a 16bit number.

General discussion on mikroBasic PRO for 8051.
Post Reply
Author
Message
PaulC
Posts: 100
Joined: 03 Oct 2007 15:15
Location: Ireland

is it possible to convert 16 switches to a 16bit number.

#1 Post by PaulC » 17 Jul 2012 19:50

is it possible to convert 16 switches to a 16bit number.
the washing machine doesn't have a readout on it.or a finished cycle beeper.
i figured out the beeper part by reading the led high enable on end cycle & Door, also put timer on them to shut up beeper after 30 seconds.
now i want to read where the dial is so can calculate time left according to manual & display how many minutes left till end on 3 x 7-segment.
so it will only read one switch to gnd.
giving on 16 possible numbers to check, so if i could read the 16 switch's & Convert to binary, i could convert this to the 16 bit number, & would know the time from a data[15] statement.
i will figure out how to do this in the 4k limit later.
Many thanks
Paul
Read it - Figure it - Share it

robert_d1968
Posts: 145
Joined: 14 Nov 2012 00:30
Location: China
Contact:

Re: is it possible to convert 16 switches to a 16bit number.

#2 Post by robert_d1968 » 26 Nov 2012 22:06

Hello there,

I gave you three examples you can try out in the AVR forum.

http://www.mikroe.com/forum/viewtopic.php?f=81&t=49549

Robert

Post Reply

Return to “mikroBasic PRO for 8051 General”