Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
means.simple think works
Punch cards and paper tape used to work this way. Maybe punch two rows of holes. On row has a hole in every position and serves as a clock to tell the circuit to look for a hole. If there is a hole in the other row it is a zero and no hole a one (or the other way around).lsn
can we make sth just stupid like make holes for example 4 holes so 16 different things and if the hole is empty i mean so by using sensor for light if there is light soo it's 1
or not?
plz suggestions
sorry my english is not good
0 0 0 0 ----> XC
0 0 ----> XD
untested code in c
// read 4 bit from bar code
// port bits go low when light is seen
main void(main)
{
unsigned char bitNum;
unsigned char result = 0; // 1 byte of data
for(bitNum=0;bitNum<4;bitNum++) // read 4 bits
{
result = result << 1; // shift result 1 bit left
while (PORTB & 0x02); // Wait for RB1 to detect light
result = result + (PORTB & 0x01); // add in data bit RB0
}
// 4 bit number is in result
while(1); // done so loop here
}