The problems the Arduino sketch software throws a paddy at is delays/fat16 statements within the coding.
If you posted the code that caused the compiler to "throw a paddy", we could probably help you modify it to the compiler's liking.
The problems the Arduino sketch software throws a paddy at is delays/fat16 statements within the coding.
If you posted the code that caused the compiler to "throw a paddy", we could probably help you modify it to the compiler's liking.
Sorry it seems i accidently remove my original post so hear it is again.
I hope this is the right place for posting these questions.
Hi all,
Im completely new to all this programming and with its terminology so will try to explain my problems the best way I can.
Got my Arduino last week I spent some time figured out how the board works in relationship to the atmega168 and the atmega328 so with that info i put together a comprehensive package to assist with any projects, I got my first project up, and running without any problems using the Arduino sketch software.
I did the blinking LED projects and a LCD 16x2 and 24x2 welcome projects. For my unassisted first project I wanted to shutdown the Arduino by pushing and holding a button down for 10 seconds and to reboot the Arduino push the same button again, it worked just fine using the Arduino sketch software.
So moved on to my MIDI project got most of the coding off the net, when I try to compile/send to the Arduino using the Arduino sketch software it comes up with over 200 errors so want load anything.
Now using the same coding but using AVR studio it all works fine well almost it does report 4 warnings but all seems to work as predicted.
I would like to use Arduino sketch software as AVR studio don't seem to let me simply upload to my Arduino, I have to compile a hex file with AVR studio using the off the net code and use PonyProg with a home made programmer then remove the Atmega and place it into the Arduino to run my project, seems a bit long winded but my MIDI project works fantastic. So a bit pointless having the Arduino as I could just use a breadboard for the complete project. I need to change/develop things quite a bit that's why I went for the Arduino thinking I could just use Arduino sketch software but that seems to be out.
The problems the Arduino sketch software throws a paddy at is delays/fat16 statements within the coding.
So can I use my Arduino with AVR studio in the same way as the Arduino sketch software?
If so, how.
Thanks for any replies.
How do i post large sketchers?
There are 87,477 characters without spacers in just one of the 6 sketchers that's required, i just tried to post it but the forum system won't allow it.
Im completely new to all this programming
There are 87,477 characters without spacers in just one of the 6 sketchers
That doesn't quite tie-in with being a newbie.
Typically, newbie sketches are a couple of hundred characters long.
Sorry: so how do i post large files then please?
It's not all my work like i say it's all off the net just played about with it a bit to get it working.
it's all of the net
You squeezed all of the net into 87K?
Wow!
Start with posting one function that won't compile.
Ok thanks this is the first part that won't compile under Arduino sketch,
I know it relates to an mp3 but it works just fine in AVR studio.
This is the Code its named delay.c and is just one part of 6; it may turnout to be just me not understanding Arduino sketch,
Just for reference in my sketch I have 6 tabs,
Sketch_main
Delay.c
Fat16.c
Lcd.c
mmc.c
spi.c
/*
* a.lp_mp3 - Open Source Atmel AVR based MP3 Player
* Copyright (c) 2003-2004 K. John '2B|!2B' Crispin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
*
* Feedback, Bugs.... mail john{AT}phrozen.org
*
*/
// TODO:
// add preprocessors for different cpu speeds
#include <avr/io.h>
#include "types.h"
// delays n microseconds
// for 8MHZ 8 ticks
// for 4 mhz 4 ticks
// assuming a for loop is 3 commands in asm --> inc, tst, jmp
// if a loop takes more or less then 3 let me know. this is sort of a guess
[glow]void delay_us(u08up n) {[/glow]
for(;n>0;n--){
NOP;NOP;NOP;NOP;
}
}
void delay_ms(u16up m){
u16up n;
for(;m>0;m--){
for(n = 1000 ;n>0;n--){
NOP;NOP;
}
}
}
The next problem is with the fat16.c sketch.
This is just part of the fat16.c sketch I have highlighted the first problem but theirs many in this one.
#include "types.h"
#include "mrmidi2.h"
#include "mmc.h"
#ifndef LED_DISP
#include "lcd.h"
#else
#define lcd_data(a) ;
#define lcd_setcur(a, b) ;
#define lcd_data(a) ;
#define lcd_string(a, b) ;
#define lcd_init() ;
#define lcd_hex_u08(a) ;
#define lcd_hex_u16(a) ;
#define lcd_number(a, b) ;
#define lcd_number_k(a) ;
#endif
#include "delay.h"
#include "fat16.h"
#ifdef USE_RTC
#include "clock.h"
#endif
#include <avr/pgmspace.h>
struct fat_filedata_st fat_filedata;
[glow]static u16 fat_pos, fat_size, file_pos, root_pos, sect_offs/*, totalcl,*/;[/glow]
static u08 cluster_size, fat_cnt;
#ifndef NO_RECORD
static u16 startfatoffs, startfatcnt, clcnt;
static u08 last_rdoffs, maxfilenum=0;
#endif
#ifdef DIR_SUPPORT
#ifndef NO_RECORD
#ifdef WR_DIR_SUPPORT
static u32 last_rdsect=0;
#else
static u16 last_rdsect=0;
#endif
#endif
u16 dircl=0;
static u08 dirfatflag=0;
#define DIR_ALLOCATE_CLUSTER 1
#define NEW_CLUSTER_ALLOC 2
#else
#ifndef NO_RECORD
static u16 last_rdsect=0;
#endif
#endif
u08 filemode=0, fat_directaccess=0;
#ifdef BUFFERED_FILEENTRIES
#define BFE_STEP 5
u16 gl_fenr;
u16 fe_buf[(1<<(8-BFE_STEP))-1];
#endif
#ifdef USE_RTC
struct time_st {
u08 gl_sek, gl_min, gl_std, gl_tag, gl_mon, gl_jahr;
};
extern struct time_st gl_time;
#endif
OK, so where have you defined the datatype "u08up"?
(please use the # (code) icon on the editor's toolbar when posting code.
OK, so where have you defined the datatype "u08up"?
I believe that's in the Sketch_main
(please use the # (code) icon on the editor's toolbar when posting code.
Thanks I was looking how to do that.
You haven't said what the errors are when you try to compile this code. But, the sketches use some unusual data types. If the compiler is complaining about them, you need to figure out where they are defined, and make sure each sketch knows about where they are defined.
If that is not the problem, you need to tell us what the problem is.
Thanks I understand what you're asking but im out me depth a lot so im on a very steep learning curve more like a wall at the moment.
This is the Code errors from delay.c from the Arduino sketch,
delay.c:27:18: error types.h: No such file or directory
delay.c:33: error: expected ')' before 'n'
delay.c:39: error: expected ')' before 'm'
and thanks.
There's been a long running thread active lately that talks about the fact that types.h is missing from 0019.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285315867/1
You might need to install an older version of the software, unless you have a Uno.
Ok solved some of the problems by adding a new sketch delay.h in the form of a tap that seems to have solved the delay problem.
Done the same for the rest of the error *****.h: No such file or directory
And that's now addressed a lot of the problems, now have 13 sketchers in my project.
Now down to 11 errors from over 200.
These are the errors that show up now when compiling fat16.c
Just off to go and see the post you have directed me to,
Thanks for your help.
Well it's up and running, see link below, and thanks to all that helped.
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294764466/0#0