Pages: [1]   Go Down
Author Topic: need a guidance  (Read 396 times)
0 Members and 1 Guest are viewing this topic.
Rennes- FRANCE
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
 
Logged

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

Queens, New York
Online Online
Faraday Member
**
Karma: 108
Posts: 3778
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 04, 2012, 10:24:23 am by HazardsMind » Logged

Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Rennes- FRANCE
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks....

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

thanks.
Logged

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

Rennes- FRANCE
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* nixie.JPG (93.09 KB, 925x643 - viewed 19 times.)
Logged

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

Pages: [1]   Go Up
Jump to: