i just need a guidance for my project...i'm currently work under a nixie clock with a RTC (Ds1307) and an Arduino UNO.
My problem is that after reading inside the DS1307 chip all the datas in HEXA (seconds,minutes and Hours). So ,All the values are in hexa (for example : 30secondes --> 0011 0000) and i don't know how to assign a byte to a digital output.
In this example, '3' --> (0011), i would like to send 0 to Digital output 0 &1, 1 to digital output 2 & 3.
i hope you will understand my problem.
Can i have a little help?please?
Is it possible to have a example for reading in I2C chip at a specific adress?
In this example, '3' --> (0011), i would like to send 0 to Digital output 0 &1, 1 to digital output 2 & 3.
you can use a split function.
use an IF statement and multiple case statements for the number of pins you want to output.
Pseudocode.
if new data is available, then send data to pin 2, then switch case. Do that for all the output pins, until the last case where once it sends out the data, it resets the cases back to zero.
sheer:
In this example, '3' --> (0011), i would like to send 0 to Digital output 0 &1, 1 to digital output 2 & 3.
What you seem to be asking for is how to extract the value of an individual bit from a variable. You can do it either by applying the bitwise operators directly to mask out individual bits from the value, or using the Arduino bitRead() function.
For example, it would be easy to set up an array of pin numbers and loop through the array, extracting the corresponding bit from your value and outputting it to the pin.