Форум обсуждения систем  

Вернуться   Форум обсуждения систем "Умный дом", проектов Ардуино, OpenWRT и других DIY устройств > Форум умного дома > Сделай сам

Ответ
 
Опции темы Поиск в этой теме Опции просмотра
Старый 05.09.2013, 20:12   #91
Ромка
Member
 
Регистрация: 11.08.2013
Сообщений: 57
Вес репутации: 0
Ромка is an unknown quantity at this point
По умолчанию

Как оказалось-она уже была только вот один фиг не катит
Ромка вне форума   Ответить с цитированием
Старый 05.09.2013, 20:44   #92
Admin
Administrator
 
Аватар для Admin
 
Регистрация: 12.04.2010
Адрес: Москва
Сообщений: 9,616
Вес репутации: 9821
Admin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant future
По умолчанию

Цитата:
Вот сам сгенерированный скетч уже не проходит ,даже без правки IK команд
Что то я не понимаю, ты писал что не компилируется чистый генерированный скетч, а показываешь ошибки, которые вылетают от того что в этом скетче не прописана библиотека CyberLib
Admin вне форума   Ответить с цитированием
Старый 05.09.2013, 21:28   #93
Ромка
Member
 
Регистрация: 11.08.2013
Сообщений: 57
Вес репутации: 0
Ромка is an unknown quantity at this point
По умолчанию

Нее , компиляция прошла успешно, не проходит проверка скетча перед заливкой на arduino
Ромка вне форума   Ответить с цитированием
Старый 05.09.2013, 21:41   #94
Admin
Administrator
 
Аватар для Admin
 
Регистрация: 12.04.2010
Адрес: Москва
Сообщений: 9,616
Вес репутации: 9821
Admin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant future
По умолчанию

Добавь библиотеку , вставь строку в начало кода
#include <CyberLib.h>
Admin вне форума   Ответить с цитированием
Старый 05.09.2013, 22:40   #95
Ромка
Member
 
Регистрация: 11.08.2013
Сообщений: 57
Вес репутации: 0
Ромка is an unknown quantity at this point
По умолчанию

Теперь это:
sketch_sep06a:3: error: 'port' was not declared in this scope
sketch_sep06a.ino: In function 'void setup()':
sketch_sep06a:37: error: 'port' was not declared in this scope
Ромка вне форума   Ответить с цитированием
Старый 05.09.2013, 22:47   #96
Admin
Administrator
 
Аватар для Admin
 
Регистрация: 12.04.2010
Адрес: Москва
Сообщений: 9,616
Вес репутации: 9821
Admin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant future
По умолчанию

Выложи скетч я подправлю
Admin вне форума   Ответить с цитированием
Старый 05.09.2013, 22:54   #97
Ромка
Member
 
Регистрация: 11.08.2013
Сообщений: 57
Вес репутации: 0
Ромка is an unknown quantity at this point
По умолчанию

Вот он:
PHP код:
#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #include "SoftwareSerial.h"
  
SoftwareSerial port(12,13);
#else // Arduino 0022 - use modified NewSoftSerial
  #include "WProgram.h"
  #include "NewSoftSerial.h"
  
NewSoftSerial port(12,13);
#endif

#include "EasyVR.h"
EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  
GROUP_0  0,
  
GROUP_1  1,
  
GROUP_2  2,
  
GROUP_3  3,
};

enum Group0 
{
  
G0_EVA 0,
};

enum Group1 
{
  
G1_SWITH 0,
  
G1_KOMPUTER 1,
  
G1_EVA 2,
};

enum Group2 
{
  
G2_ON 0,
  
G2_OFF 1,
};

enum Group3 
{
  
G3_LIGHT 0,
};


EasyVRBridge bridge;

int8_t groupidx;

void setup()
{
  
// bridge mode?
  
if (bridge.check())
  {
    
cli();
    
bridge.loop(011213);
  }
  
// run normally
  
Serial.begin(9600);
  
port.begin(9600);

  if (!
easyvr.detect())
  {
    
Serial.println("EasyVR not detected!");
    for (;;);
  }

  
easyvr.setPinOutput(EasyVR::IO1LOW);
  
Serial.println("EasyVR detected!");
  
easyvr.setTimeout(5);
  
easyvr.setLanguage(0);

  
group EasyVR::TRIGGER//<-- start group (customize)
}

void action();

void loop()
{
  
easyvr.setPinOutput(EasyVR::IO1HIGH); // LED on (listening)

  
Serial.print("Say a command in Group ");
  
Serial.println(group);
  
easyvr.recognizeCommand(group);

  do
  {
    
// can do some processing while waiting for a spoken command
  
}
  while (!
easyvr.hasFinished());
  
  
easyvr.setPinOutput(EasyVR::IO1LOW); // LED off

  
idx easyvr.getWord();
  if (
idx >= 0)
  {
    
// built-in trigger (ROBOT)
    // group = GROUP_X; <-- jump to another group X
    
return;
  }
  
idx easyvr.getCommand();
  if (
idx >= 0)
  {
    
// print debug message
    
uint8_t train 0;
    
char name[32];
    
Serial.print("Command: ");
    
Serial.print(idx);
    if (
easyvr.dumpCommand(groupidxnametrain))
    {
      
Serial.print(" = ");
      
Serial.println(name);
    }
    else
      
Serial.println();
    
easyvr.playSound(0EasyVR::VOL_FULL);
    
// perform some action
    
action();
  }
  else 
// errors or timeout
  
{
    if (
easyvr.isTimeout())
      
Serial.println("Timed out, try again...");
    
int16_t err easyvr.getError();
    if (
err >= 0)
    {
      
Serial.print("Error ");
      
Serial.println(errHEX);
    }
  }
}

void action()
{
    switch (
group)
    {
    case 
GROUP_0:
      switch (
idx)
      {
      case 
G0_EVA:
unsigned long ir_code=ReadEEPROM_Long(0);//прочитать код кнопоки из EEPROM в переменную  
for (int i 03i++) { irsend.sendsSamsung(ir_code9);  delay_ms(100); }//теперь считанный код передаем по ИК каналу  
        
break;
      }
      break;
    case 
GROUP_1:
      switch (
idx)
      {
      case 
G1_SWITH:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      case 
G1_KOMPUTER:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      case 
G1_EVA:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      }
      break;
    case 
GROUP_2:
      switch (
idx)
      {
      case 
G2_ON:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      case 
G2_OFF:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      }
      break;
    case 
GROUP_3:
      switch (
idx)
      {
      case 
G3_LIGHT:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      }
      break;
    }

Ромка вне форума   Ответить с цитированием
Старый 05.09.2013, 23:17   #98
Admin
Administrator
 
Аватар для Admin
 
Регистрация: 12.04.2010
Адрес: Москва
Сообщений: 9,616
Вес репутации: 9821
Admin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant future
По умолчанию

Подправил, у меня компилируется
PHP код:
#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
  #include "SoftwareSerial.h"
  
SoftwareSerial port(12,13);
#else // Arduino 0022 - use modified NewSoftSerial
  #include "WProgram.h"
  #include "NewSoftSerial.h"
  
NewSoftSerial port(12,13);
#endif

#include "EasyVR.h"
EasyVR easyvr(port);

//Groups and Commands
enum Groups
{
  
GROUP_0  0,
  
GROUP_1  1,
  
GROUP_2  2,
  
GROUP_3  3,
};

enum Group0 
{
  
G0_EVA 0,
};

enum Group1 
{
  
G1_SWITH 0,
  
G1_KOMPUTER 1,
  
G1_EVA 2,
};

enum Group2 
{
  
G2_ON 0,
  
G2_OFF 1,
};

enum Group3 
{
  
G3_LIGHT 0,
};


EasyVRBridge bridge;

int8_t groupidx;

void setup()
{
  
// bridge mode?
  
if (bridge.check())
  {
    
cli();
    
bridge.loop(011213);
  }
  
// run normally
  
Serial.begin(9600);
  
port.begin(9600);

  if (!
easyvr.detect())
  {
    
Serial.println("EasyVR not detected!");
    for (;;);
  }

  
easyvr.setPinOutput(EasyVR::IO1LOW);
  
Serial.println("EasyVR detected!");
  
easyvr.setTimeout(5);
  
easyvr.setLanguage(0);

  
group EasyVR::TRIGGER//<-- start group (customize)
}

void action();

void loop()
{
  
easyvr.setPinOutput(EasyVR::IO1HIGH); // LED on (listening)

  
Serial.print("Say a command in Group ");
  
Serial.println(group);
  
easyvr.recognizeCommand(group);

  do
  {
    
// can do some processing while waiting for a spoken command
  
}
  while (!
easyvr.hasFinished());
  
  
easyvr.setPinOutput(EasyVR::IO1LOW); // LED off

  
idx easyvr.getWord();
  if (
idx >= 0)
  {
    
// built-in trigger (ROBOT)
    // group = GROUP_X; <-- jump to another group X
    
return;
  }
  
idx easyvr.getCommand();
  if (
idx >= 0)
  {
    
// print debug message
    
uint8_t train 0;
    
char name[32];
    
Serial.print("Command: ");
    
Serial.print(idx);
    if (
easyvr.dumpCommand(groupidxnametrain))
    {
      
Serial.print(" = ");
      
Serial.println(name);
    }
    else
      
Serial.println();
    
easyvr.playSound(0EasyVR::VOL_FULL);
    
// perform some action
    
action();
  }
  else 
// errors or timeout
  
{
    if (
easyvr.isTimeout())
      
Serial.println("Timed out, try again...");
    
int16_t err easyvr.getError();
    if (
err >= 0)
    {
      
Serial.print("Error ");
      
Serial.println(errHEX);
    }
  }
}

void action()
{
    switch (
group)
    {
    case 
GROUP_0:
      switch (
idx)
      {
      case 
G0_EVA
        break;
      }
      break;
    case 
GROUP_1:
      switch (
idx)
      {
      case 
G1_SWITH:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      case 
G1_KOMPUTER:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      case 
G1_EVA:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      }
      break;
    case 
GROUP_2:
      switch (
idx)
      {
      case 
G2_ON:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      case 
G2_OFF:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      }
      break;
    case 
GROUP_3:
      switch (
idx)
      {
      case 
G3_LIGHT:
        
// write your action code here
        // group = GROUP_X; <-- or jump to another group X for composite commands
        
break;
      }
      break;
    }

Admin вне форума   Ответить с цитированием
Старый 06.09.2013, 06:31   #99
Ромка
Member
 
Регистрация: 11.08.2013
Сообщений: 57
Вес репутации: 0
Ромка is an unknown quantity at this point
По умолчанию

У меня так и не проходит:
In file included from sketch_sep06a.ino:3:
C:\Program Files (x86)\Arduino\libraries\SoftwareSerial/SoftwareSerial.h:52: error: conflicting return type specified for 'virtual void SoftwareSerial::write(uint8_t)'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\ard uino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
Ромка вне форума   Ответить с цитированием
Старый 06.09.2013, 10:14   #100
Admin
Administrator
 
Аватар для Admin
 
Регистрация: 12.04.2010
Адрес: Москва
Сообщений: 9,616
Вес репутации: 9821
Admin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant futureAdmin has a brilliant future
По умолчанию

Попробуй все таки по новой сгенерируй скетч
Я уже писал об этом, но ты как я понял не ищеш легких путей
Возможно что ты где то что то отредактировал и забыл
Admin вне форума   Ответить с цитированием
Ответ


Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
 

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Быстрый переход


Текущее время: 18:25. Часовой пояс GMT +3.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Яндекс.Метрика