Nixie clock ИН-12а
- Войдите на сайт для отправки комментариев
Сб, 23/07/2016 - 17:15
День добрый, прощу помощи у спецов. уже не знаю что поделать: собрана монтажная схема, залита программа, но часы не работают. 
| R1 | 3.3 kΩ |
| R2 | 3.3 kΩ |
| R3 | 3.3 kΩ |
| R4 | 470 kΩ |
| R5 | 470 kΩ |
| R6 | 470 kΩ |
| R7 | 15 kΩ |
| R8 | 15 kΩ |
| R9 | 15 kΩ |
| R10 | 100 kΩ |
| R11 | 100 kΩ |
| R12 | 100 kΩ |
| R13 | 2.2 kΩ |
| Q1 | MPSA42 NPN |
| Q2 | MPSA42 NPN |
| Q3 | MPSA42 NPN |
| Q4 | MPSA92 PNP |
| Q5 | MPSA92 PNP |
| Q6 | MPSA92 PNP |
J12= PCF8563 но у меня DS3231
J13=DHT22 его нет у меня
J10= Bluetooth RF transceiver HC-06 нет у меня
#include <Wire.h>
#include <Rtc_Pcf8563.h>
#include <DHT.h>
#define DHTPIN 13
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
//Library for multiplexing the Nixie clock
#include <NixieAS.h>
//int pinLayout[] = {PINA_IC1, PINB_IC1, PINC_IC1, PIND_IC1, PINA_IC2, PINB_IC2, PINC_IC2, PIND_IC2, PAIR1, PAIR2, PAIR3};
int pinLayout[] = {5, 3, 2, 4, 9, 7, 6, 8, 12, 11, 10};
NixieAS nix(&pinLayout[0]);
int nums[] = {1,3,3,7,0,0};
unsigned char time_raw[7];
//Variable handle for real time clock object
Rtc_Pcf8563 rtc;
int pre_sec = 0;
int cur_sec = 0;
/*For storeing time and date from user*/
/*unsigned char time_date_raw[13];
int pos = 0;
char byteRead;*/
void setup() {
Serial.begin(9600);
rtc.initClock();
rtc.setDate(1, 3, 3, 7, 10);
rtc.setTime(1, 13, 37);
dht.begin();
}
void updRtcTime(){
rtc.getTime();
byte ss = rtc.getSecond();
byte mm = rtc.getMinute();
byte hh = rtc.getHour();
nums[0] = hh / 10;
nums[1] = hh % 10;
nums[2] = mm / 10;
nums[3] = mm % 10;
nums[4] = ss / 10;
nums[5] = ss % 10;
}
void setRTC(){
int dateTime[3];
//Check if 0 in front of single day/month/year/hh/mm/ss . Ex: 01 02 03
for(int i=0; i<3; i++){
if(time_raw[2*i] == '0'){
dateTime[i] = time_raw[2*i+1]-'0';
}else{
//Convert char to int with - '0'
dateTime[i] = 10*(time_raw[2*i]-'0')+(time_raw[2*i+1]-'0');
}
}
//rtc.setDate(dateTime[0], 0, dateTime[1], 0, dateTime[2]);
rtc.setTime(dateTime[0], dateTime[1], dateTime[2]);
for(int i=0; i < 30; i++){
nums[0] = random(0, 10);
nums[1] = random(0, 10);
nums[2] = random(0, 10);
nums[3] = random(0, 10);
nums[4] = random(0, 10);
nums[5] = random(0, 10);
nix.showDigits(&nums[0],1);
}
}
void displayTempHumid(){
int temp = (int)dht.readTemperature();
int humi = (int)dht.readHumidity();
for(int i=0; i < 180; i++){
nums[0] = humi/10;
nums[1] = humi%10;
nums[2] = nums[2] = 0;
nums[3] = nums[2] = 0;
nums[4] = temp/10;
nums[5] = temp%10;
nix.showDigits(&nums[0],2);
}
}
void readBluetooth(){
int pos = 0;
char byteRead;
//Listen for user commands
if(Serial.available()) {
/* read the most recent byte */
byteRead = Serial.read();
//Trigger and capture data when char '#' is found
if(byteRead == '#'){
while(pos < 7 && Serial.available() > 0){
byteRead = Serial.read();
time_raw[pos] = byteRead;
pos++;
time_raw[pos] = '\0'; //Null terminate string - indicates end of string
}
//Set the time and date after recieving all data from user
setRTC();
}
}
}
void loop() {
//Se if bluetooth instructions are available
readBluetooth();
//Update digits for nixie based on RTC IC
updRtcTime();
//Display temperature and humidity every 15 sec
if(abs((nums[4]*10+nums[5])-pre_sec) > 30){
displayTempHumid();
updRtcTime();
pre_sec = (nums[4]*10+nums[5]);
}
//Call showDigits that will display nums. Every digit will be on for 2 ms
nix.showDigits(&nums[0],2);
}
А что именно не работает?
И может ли быть, что не работает именно из-за отсутствующих деталей?
Я даже не знаю, может программное запустить часы?
А Вы проверяли, насколько PCF8563 и DS3231 совпадают по управлению?
Может, лучше использовать библиотеку от DS3231?
В общем так
#include <Wire.h> #include <DS1307.h> #include <DHT.h> #define DHTPIN 13 #define DHTTYPE DHT22 DHT dht(DHTPIN, DHTTYPE); //Library for multiplexing the Nixie clock #include <NixieAS.h> //int pinLayout[] = {PINA_IC1, PINB_IC1, PINC_IC1, PIND_IC1, PINA_IC2, PINB_IC2, PINC_IC2, PIND_IC2, PAIR1, PAIR2, PAIR3}; int pinLayout[] = {5, 3, 2, 4, 9, 7, 6, 8, 12, 11, 10}; NixieAS nix(&pinLayout[0]); int nums[] = {1,3,3,7,0,0}; unsigned char time_raw[7]; //Variable handle for real time clock object DS1307 rtc; int pre_sec = 0; int cur_sec = 0; /*For storeing time and date from user*/ /*unsigned char time_date_raw[13]; int pos = 0; char byteRead;*/ void setup() { Serial.begin(9600); rtc.initClock(); rtc.setDate(1, 3, 3, 7, 10); rtc.setTime(1, 13, 37); dht.begin(); } void updRtcTime(){ rtc.getTime(); byte ss = rtc.getSecond(); byte mm = rtc.getMinute(); byte hh = rtc.getHour(); nums[0] = hh / 10; nums[1] = hh % 10; nums[2] = mm / 10; nums[3] = mm % 10; nums[4] = ss / 10; nums[5] = ss % 10; } void setRTC(){ int dateTime[3]; //Check if 0 in front of single day/month/year/hh/mm/ss . Ex: 01 02 03 for(int i=0; i<3; i++){ if(time_raw[2*i] == '0'){ dateTime[i] = time_raw[2*i+1]-'0'; }else{ //Convert char to int with - '0' dateTime[i] = 10*(time_raw[2*i]-'0')+(time_raw[2*i+1]-'0'); } } //rtc.setDate(dateTime[0], 0, dateTime[1], 0, dateTime[2]); rtc.setTime(dateTime[0], dateTime[1], dateTime[2]); for(int i=0; i < 30; i++){ nums[0] = random(0, 10); nums[1] = random(0, 10); nums[2] = random(0, 10); nums[3] = random(0, 10); nums[4] = random(0, 10); nums[5] = random(0, 10); nix.showDigits(&nums[0],1); } } void displayTempHumid(){ int temp = (int)dht.readTemperature(); int humi = (int)dht.readHumidity(); for(int i=0; i < 180; i++){ nums[0] = humi/10; nums[1] = humi%10; nums[2] = nums[2] = 0; nums[3] = nums[2] = 0; nums[4] = temp/10; nums[5] = temp%10; nix.showDigits(&nums[0],2); } } void readBluetooth(){ int pos = 0; char byteRead; //Listen for user commands if(Serial.available()) { /* read the most recent byte */ byteRead = Serial.read(); //Trigger and capture data when char '#' is found if(byteRead == '#'){ while(pos < 7 && Serial.available() > 0){ byteRead = Serial.read(); time_raw[pos] = byteRead; pos++; time_raw[pos] = '\0'; //Null terminate string - indicates end of string } //Set the time and date after recieving all data from user setRTC(); } } } void loop() { //Se if bluetooth instructions are available readBluetooth(); //Update digits for nixie based on RTC IC updRtcTime(); //Display temperature and humidity every 15 sec if(abs((nums[4]*10+nums[5])-pre_sec) > 30){ displayTempHumid(); updRtcTime(); pre_sec = (nums[4]*10+nums[5]); } //Call showDigits that will display nums. Every digit will be on for 2 ms nix.showDigits(&nums[0],2); }Выдает ошибку, но эту библиотеку уже использовал нормально.
Arduino: 1.6.9 (Windows 7), Плата:"Arduino Nano, ATmega328"
sketch_jun10a.ino.ino:22: error: no matching function for call to 'DS1307::DS1307()'
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:22:8: note: candidates are:
In file included from C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:3:0:
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:86:3: note: DS1307::DS1307(uint8_t, uint8_t)
DS1307(uint8_t data_pin, uint8_t sclk_pin);
^
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:86:3: note: candidate expects 2 arguments, 0 provided
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:83:7: note: constexpr DS1307::DS1307(const DS1307&)
class DS1307
^
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:83:7: note: candidate expects 1 argument, 0 provided
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:83:7: note: constexpr DS1307::DS1307(DS1307&&)
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:83:7: note: candidate expects 1 argument, 0 provided
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino: In function 'void setup()':
sketch_jun10a.ino.ino:35: error: 'class DS1307' has no member named 'initClock'
sketch_jun10a.ino.ino:36: error: no matching function for call to 'DS1307::setDate(int, int, int, int, int)'
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:36:29: note: candidate is:
In file included from C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:3:0:
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:89:7: note: void DS1307::setDate(uint8_t, uint8_t, uint16_t)
void setDate(uint8_t date, uint8_t mon, uint16_t year);
^
C:\Users\Админ\Documents\Arduino\libraries\DS1307/DS1307.h:89:7: note: candidate expects 3 arguments, 5 provided
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino: In function 'void updRtcTime()':
sketch_jun10a.ino.ino:45: error: 'class DS1307' has no member named 'getSecond'
sketch_jun10a.ino.ino:46: error: 'class DS1307' has no member named 'getMinute'
sketch_jun10a.ino.ino:47: error: 'class DS1307' has no member named 'getHour'
exit status 1
no matching function for call to 'DS1307::DS1307()'
С уважением от Дмитрия.
А при библиотеке
Arduino: 1.6.9 (Windows 7), Плата:"Arduino Nano, ATmega328"
sketch_jun10a.ino.ino:22: error: no matching function for call to 'DS3231::DS3231()'
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:22:8: note: candidates are:
In file included from C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:3:0:
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:80:3: note: DS3231::DS3231(uint8_t, uint8_t)
DS3231(uint8_t data_pin, uint8_t sclk_pin);
^
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:80:3: note: candidate expects 2 arguments, 0 provided
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:77:7: note: constexpr DS3231::DS3231(const DS3231&)
class DS3231
^
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:77:7: note: candidate expects 1 argument, 0 provided
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:77:7: note: constexpr DS3231::DS3231(DS3231&&)
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:77:7: note: candidate expects 1 argument, 0 provided
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino: In function 'void setup()':
sketch_jun10a.ino.ino:35: error: 'class DS3231' has no member named 'initClock'
sketch_jun10a.ino.ino:36: error: no matching function for call to 'DS3231::setDate(int, int, int, int, int)'
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:36:29: note: candidate is:
In file included from C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino:3:0:
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:84:8: note: void DS3231::setDate(uint8_t, uint8_t, uint16_t)
void setDate(uint8_t date, uint8_t mon, uint16_t year);
^
C:\Users\Админ\Documents\Arduino\libraries\DS3231/DS3231.h:84:8: note: candidate expects 3 arguments, 5 provided
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino: In function 'void updRtcTime()':
sketch_jun10a.ino.ino:45: error: 'class DS3231' has no member named 'getSecond'
sketch_jun10a.ino.ino:46: error: 'class DS3231' has no member named 'getMinute'
sketch_jun10a.ino.ino:47: error: 'class DS3231' has no member named 'getHour'
exit status 1
no matching function for call to 'DS3231::DS3231()'
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"
Сравните то, как вызывается конструктор класса в файле DS3231.h с тем, как Вы описывавете его в своей программе.
Надо 21 строку назвать rts?
Вы прочитайте сообщения об ошибках - компилятор не может понять, какой конструктор ему нужно использовать. Между собой он различает их по количеству и типу параметров. Вот и опишите rts по однму из тех шаблонов, что приведены в файле DS3231.h.
О боже как все сложно( мозги кипят...
А никто иного и не обещал.
Если беспорядочно стучать по клавишам, "Война и мир" не получится. Для отладки программы просто необдходимо внимательно читать, что Вам сообщает компилятор.
А не подскажите что имеено менять?
Я бы в первую очередь посмотрел в сторону строки 21.
Правильно?
Не подскажите где библиот. взять и пример для теста часов взять проверить модуль?
Ошибка на 43 строке #include <Wire.h> #include <DS1307.h> #include <DHT.h> #define DHTPIN 13 #define DHTTYPE DHT22 DHT dht(DHTPIN, DHTTYPE); //Library for multiplexing the Nixie clock #include <NixieAS.h> //int pinLayout[] = {PINA_IC1, PINB_IC1, PINC_IC1, PIND_IC1, PINA_IC2, PINB_IC2, PINC_IC2, PIND_IC2, PAIR1, PAIR2, PAIR3}; int pinLayout[] = {5, 3, 2, 4, 9, 7, 6, 8, 12, 11, 10}; NixieAS nix(&pinLayout[0]); int nums[] = {1,3,3,7,0,0}; unsigned char time_raw[7]; //Variable handle for real time clock object DS1307 rtc(A4, A5); int pre_sec = 0; int cur_sec = 0; /*For storeing time and date from user*/ /*unsigned char time_date_raw[13]; int pos = 0; char byteRead;*/ void setup() { Serial.begin(9600); rtc.setDOW(SUNDAY); rtc.setTime(19, 0, 0); rtc.setDate(24, 07, 2016); dht.begin(); } void updRtcTime(){ rtc.getTime(); byte ss = rtc.getSecond(); byte mm = rtc.getMinute(); byte hh = rtc.getHour(); nums[0] = hh / 10; nums[1] = hh % 10; nums[2] = mm / 10; nums[3] = mm % 10; nums[4] = ss / 10; nums[5] = ss % 10; } void setRTC(){ int dateTime[3]; //Check if 0 in front of single day/month/year/hh/mm/ss . Ex: 01 02 03 for(int i=0; i<3; i++){ if(time_raw[2*i] == '0'){ dateTime[i] = time_raw[2*i+1]-'0'; }else{ //Convert char to int with - '0' dateTime[i] = 10*(time_raw[2*i]-'0')+(time_raw[2*i+1]-'0'); } } //rtc.setDate(dateTime[0], 0, dateTime[1], 0, dateTime[2]); rtc.setTime(dateTime[0], dateTime[1], dateTime[2]); for(int i=0; i < 30; i++){ nums[0] = random(0, 10); nums[1] = random(0, 10); nums[2] = random(0, 10); nums[3] = random(0, 10); nums[4] = random(0, 10); nums[5] = random(0, 10); nix.showDigits(&nums[0],1); } } void displayTempHumid(){ int temp = (int)dht.readTemperature(); int humi = (int)dht.readHumidity(); for(int i=0; i < 180; i++){ nums[0] = humi/10; nums[1] = humi%10; nums[2] = nums[2] = 0; nums[3] = nums[2] = 0; nums[4] = temp/10; nums[5] = temp%10; nix.showDigits(&nums[0],2); } } void readBluetooth(){ int pos = 0; char byteRead; //Listen for user commands if(Serial.available()) { /* read the most recent byte */ byteRead = Serial.read(); //Trigger and capture data when char '#' is found if(byteRead == '#'){ while(pos < 7 && Serial.available() > 0){ byteRead = Serial.read(); time_raw[pos] = byteRead; pos++; time_raw[pos] = '\0'; //Null terminate string - indicates end of string } //Set the time and date after recieving all data from user setRTC(); } } } void loop() { //Se if bluetooth instructions are available readBluetooth(); //Update digits for nixie based on RTC IC updRtcTime(); //Display temperature and humidity every 15 sec if(abs((nums[4]*10+nums[5])-pre_sec) > 30){ displayTempHumid(); updRtcTime(); pre_sec = (nums[4]*10+nums[5]); } //Call showDigits that will display nums. Every digit will be on for 2 ms nix.showDigits(&nums[0],2); }Arduino: 1.6.9 (Windows 7), Плата:"Arduino Nano, ATmega328"
C:\Users\РђРґРјРёРЅ\Documents\Arduino\sketch_jun10a\sketch_jun10a.ino\sketch_jun10a.ino.ino\sketch_jun10a.ino.ino.ino: In function 'void updRtcTime()':
sketch_jun10a.ino.ino:47: error: 'class DS1307' has no member named 'getSecond'
sketch_jun10a.ino.ino:48: error: 'class DS1307' has no member named 'getMinute'
sketch_jun10a.ino.ino:49: error: 'class DS1307' has no member named 'getHour'
exit status 1
'class DS1307' has no member named 'getSecond'
Ну та загляните в DS1307.h и посмотрите, какие методы этой библиотеки делают то же самое, что отсутствующие getSecond, getMinute и getHour.
Кроме того, Вы писали, что у Вас не 1307, а 3231. Зачем использовать библиотеку, написанную для другого железа?
Я уже не знаю, что менять. Насчет 1307 там особой разницы нет с 3231.
Вы можете написать здесь список методов (функций), имеющихся в классе 1307 (или 3231, если нет разницы)?
С примера библиот.
Adriano можно с вами связаться ?
#include <DS1307.h> // Init the DS1307 DS1307 rtc(4, 5); void setup() { // Set the clock to run-mode rtc.halt(false); // Setup Serial connection Serial.begin(57600); // The following lines can be commented out to use the values already stored in the DS1307 rtc.setDOW(SUNDAY); // Set Day-of-Week to SUNDAY rtc.setTime(12, 0, 0); // Set the time to 12:00:00 (24hr format) rtc.setDate(3, 10, 2010); // Set the date to October 3th, 2010 } void loop() { // Send Day-of-Week Serial.print(rtc.getDOWStr()); Serial.print(" "); // Send date Serial.print(rtc.getDateStr()); Serial.print(" -- "); // Send time Serial.println(rtc.getTimeStr()); // Wait one second before repeating :) delay (1000); }Еще раз: не надо никаких примеров. Тем более и пример нашли неподходящий: Вам нужны функции возвращающие число, а в примере используются функции, возвращающие строку.
Учитесь добывать данные из самой библиотеки. Описание класса содержится в файле DS1307.h. Найдите там его и процитируйте здесь.
Как этот файл открыть?
Приплыли...
Хотя бы Notepad'ом.
Ну вот смотрите: в Ваш скетч пытается обратиться к функциям возвращающим часы, минуты и секунды. А таковых, как мы видим, в данной библиотеке нет. Зато есть некая getTime(), которая возвращает переменную типа Time. Видимо, из этой Time можно как-то получить интересующие нас величины. Только как? Что такое Time? Ответ на этот вопрос можно найти в том же самом файле немного выше. Там должна быть описана структура (или класс - не знаю) Time. Ее бы тоже хорошо было посмотреть.
#ifndef DS1307_h #define DS1307_h #if defined(ARDUINO) && ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif #define DS1307_ADDR_R 209 #define DS1307_ADDR_W 208 #define FORMAT_SHORT 1 #define FORMAT_LONG 2 #define FORMAT_LITTLEENDIAN 1 #define FORMAT_BIGENDIAN 2 #define FORMAT_MIDDLEENDIAN 3 #define MONDAY 1 #define TUESDAY 2 #define WEDNESDAY 3 #define THURSDAY 4 #define FRIDAY 5 #define SATURDAY 6 #define SUNDAY 7 #define SQW_RATE_1 0 #define SQW_RATE_4K 1 #define SQW_RATE_8K 2 #define SQW_RATE_32K 3 class Time { public: uint8_t hour; uint8_t min; uint8_t sec; uint8_t date; uint8_t mon; uint16_t year; uint8_t dow; Time(); }; class DS1307_RAM { public: byte cell[56]; DS1307_RAM(); }; class DS1307 { public: DS1307(uint8_t data_pin, uint8_t sclk_pin); Time getTime(); void setTime(uint8_t hour, uint8_t min, uint8_t sec); void setDate(uint8_t date, uint8_t mon, uint16_t year); void setDOW(uint8_t dow); char *getTimeStr(uint8_t format=FORMAT_LONG); char *getDateStr(uint8_t slformat=FORMAT_LONG, uint8_t eformat=FORMAT_LITTLEENDIAN, char divider='.'); char *getDOWStr(uint8_t format=FORMAT_LONG); char *getMonthStr(uint8_t format=FORMAT_LONG); void halt(bool value); void setOutput(bool enable); void enableSQW(bool enable); void setSQWRate(int rate); void writeBuffer(DS1307_RAM r); DS1307_RAM readBuffer(); void poke(uint8_t addr, uint8_t value); uint8_t peek(uint8_t addr); private: uint8_t _scl_pin; uint8_t _sda_pin; uint8_t _burstArray[8]; void _sendStart(byte addr); void _sendStop(); void _sendAck(); void _sendNack(); void _waitForAck(); uint8_t _readByte(); void _writeByte(uint8_t value); void _burstRead(); uint8_t _readRegister(uint8_t reg); void _writeRegister(uint8_t reg, uint8_t value); uint8_t _decode(uint8_t value); uint8_t _decodeH(uint8_t value); uint8_t _decodeY(uint8_t value); uint8_t _encode(uint8_t vaule); }; #endifНу вот и отлично: вместо трех запросов отдельно часов, отдельно минут один раз спрашиваете getTime, после чего проводите следующие ниже манипуляции уже с его полями.
Вы меня радуете)) Еще понять как это сделать?
Для этого нужно:
1. Научиться работать с компьютером.
2. Приобрести хотя бы начальные навыки в программировании.
3. Ознакомиться с языками программирования С/С++.
Есть и более быстрый способ: обратиться в раздел "Ищу исполнителя".
Тут не навыки, я даже скажу болеше надо знать.
В общем нашел иностранный сайт с готовыми проектами, обьясните почему на лампы аноды идут 4 провода место 3?
http://www.hazardousphysics.com/main/rlbclock/RLB_Designs_Nixie_Tube_Clock_1.html
Учитывая что там 2 к155ид1, для индикации 6 цифр надо 6 / 2 = 3 анодных. Четвертый, если подключить к неонке, можно заставить мигать в такт секундам.
в коде
ledPin_a_1 только назначается на выход и в дальнейшем не используется.Учитывая что там 2 к155ид1, для индикации 6 цифр надо 6 / 2 = 3 анодных. Четвертый, если подключить к неонке, можно заставить мигать в такт секундам.
в коде
ledPin_a_1 только назначается на выход и в дальнейшем не используется.Ясно.
У меня к вам вопрос, с цифрового сигнала D11 у меня напряжение 1в разве не должно 5 в?