I hope someone can help me out with this one. I am new to the Visual Micro IDE and still trying to find my feet. I managed to successfully program the blinky program to my ATmega2560 micro through a USB to serial converter. However when I tried to compile a simple custom transmitter code (virtualwire) that I tried and tested with the arduino IDE it keeps on failing, giving me loads of problems, errors and warnings. What I can figure out is that Visual Micro cant read the KEYWORDS.TXT file hence the reason for some fields that are not declared, but how must I set up the file structure in the Visual Micro environment?
my usual library file for VirtualWire has the following
VirtualWire.cpp
Virtualwire.h
and here is my transmitter code
#include <VirtualWire.h>
const int enComms = 28;
unsigned int count = 0;
char countL = 0;
char countH = 0;
void setup()
{
pinMode(30, OUTPUT);
vw_set_tx_pin(14);
vw_set_ptt_pin(28);
vw_setup(2000); // Bits per sec
}
void loop()
{
digitalWrite(enComms,HIGH);
delay(10);
char msg[8] = {'h','e','l','l','o',' ',' ','#'};
msg[5] = countL;
msg[6] = countH;
digitalWrite(30, HIGH); // Flash a light to show transmitting
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(30, LOW);
//delay(1000);
count = count + 1;
countL = count & 0xff;
countH = (count >> 8);
digitalWrite(enComms,LOW);
delay(10);
}
I am getting all the following errors
Compiling 'Virtual_TX' for 'Arduino Mega 2560 or Mega ADK'
Build folder: file://C:\...\Arduino\Builds\Virtual_TX\mega2560
SketchLibFolders
Summary: Header=1 Prototypes=3 Imports=1
C:\Users\Ardiuno\arduino-1.0\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=8000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=10 -DVISUALMICRO_COMPILER_VER=1 -I"C:\...\Ardiuno\arduino-1.0\hardware\arduino\cores\arduino" -I"C:\...\Ardiuno\arduino-1.0\hardware\arduino\variants\mega" -I"C:\...\Ardiuno\arduino-1.0\libraries\VirtualWire" "C:\...\Builds\Virtual_TX\mega2560\Virtual_TX.cpp" -o "C:\...\Builds\Virtual_TX\mega2560\Virtual_TX.cpp.o"
Virtual_TX.ino : In file included from
VirtualWire.h : No such file or directory
Virtual_TX.ino : In file included from
VirtualWire.h : 'vw_set_tx_pin' initialized and declared 'extern'
VirtualWire.h : variable or field 'vw_set_tx_pin' declared void
VirtualWire.h : 'uint8_t' was not declared in this scope
VirtualWire.h : 'uint8_t' does not name a type
VirtualWire.cpp : : In function 'void vw_setup(uint16_t)':
VirtualWire.cpp : 'TCCR1A' was not declared in this scope
VirtualWire.cpp : 'TCCR1B' was not declared in this scope
VirtualWire.cpp : 'WGM12' was not declared in this scope
VirtualWire.cpp : '_BV' was not declared in this scope
VirtualWire.cpp : 'CS10' was not declared in this scope
VirtualWire.cpp : 'OCR1A' was not declared in this scope
VirtualWire.cpp : 'TIMSK' was not declared in this scope
VirtualWire.cpp : 'OCIE1A' was not declared in this scope
VirtualWire.cpp : 'OUTPUT' was not declared in this scope
VirtualWire.cpp : 'pinMode' was not declared in this scope
VirtualWire.cpp : 'INPUT' was not declared in this scope
VirtualWire.cpp : 'digitalWrite' was not declared in this scope
VirtualWire.cpp : : In function 'void vw_tx_start()':
VirtualWire.cpp : 'digitalWrite' was not declared in this scope
VirtualWire.cpp : : In function 'void vw_tx_stop()':
VirtualWire.cpp : 'digitalWrite' was not declared in this scope
VirtualWire.cpp : : In function 'uint8_t vw_wait_rx_max(long unsigned int)':
VirtualWire.cpp : 'millis' was not declared in this scope
VirtualWire.cpp : : At global scope:
VirtualWire.cpp : expected constructor, destructor, or type conversion before '(' token
VirtualWire.cpp : expected `}' at end of input
VirtualWire.cpp : 'vw_tx_msg_count' defined but not used
Error compiling
Please help me!