Go Down

Topic: need a guidance (Read 419 times) previous topic - next topic

sheer

HI,

    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?


THANKS.

if it doesn't work..knock on it!!!

HazardsMind

#1
Dec 04, 2012, 03:53 pm Last Edit: Dec 04, 2012, 04:24 pm by HazardsMind Reason: 1
Quote
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.

rinse and repeat.
My GitHub:
https://github.com/AndrewMascolo?tab=repositories

PeterH


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.
I only provide help via the forum - please do not contact me for private consultancy.

sheer

thanks....

   i will try to understand the syntax....but is it possible to have an example?

thanks.
if it doesn't work..knock on it!!!

sheer

i just add the schematic (work in progress..)

So now, what do you think about the possibility of doing an arduino based nixie Clock


thanks
if it doesn't work..knock on it!!!

Go Up