View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9081 Location: Greensville,Ontario
|
|
Posted: Tue Mar 05, 2019 8:14 am |
|
|
That depends upon WHAT the 'numbers' on the display represent.
Each 74595 can display 8 bits, so if you have an LED per output pin, you're really displaying 'binary' data.
What is the data you're trying to show? With 4 units, you can show 4 bytes for a total of 32 bits. That could be a single 32-bit number, 2 16-bit numbers, 4 8-bit numbers or 32 1-bit 'on-off' conditions. OR any combination, say 2 8-bit numbers and 16 'on-off' status bits.
How your data (numbers) gets displayed depends on what they are.
You could add 7segment displays to each of the 74595 units and have a 4 digit display that can display numbers (0000-9999) or 4 x hex (0-F) of Alphanumeric, as you have control over each segment of each display. |
|
|
art
Joined: 21 May 2015 Posts: 181
|
|
Posted: Tue Mar 05, 2019 6:06 pm |
|
|
art wrote: |
Code: |
data =gethex_usb();
write_expanded_outputs (&data);
|
|
Based on gethex it will only read BYTE.
If I want to to read 2 BYTE , what do i have to change? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19195
|
|
Posted: Wed Mar 06, 2019 1:14 am |
|
|
Declare data as a 2 byte array.
Then call get_hex as:
Code: |
data[1]=gethex_usb(); //get MSB
data[0]=gethex_usb(); //get LSB
write_expanded_outputs(data);
|
Now (obviously) the order you access the bytes in the first two lines
depend on the order you want the data presented to the output (up to
you). Also given you are then using an array, no need to '&' in the output.
This is then dependant on you having the expanded output code setup to
use two chips. So 'NUMBER_OF_74595' set to 2. |
|
|
|