Show Posts
Pages: [1]
1  Topics / Home Automation and Networked Objects / Re: Controlling Remote Controlled Sockets (SC2262 emulation by Arduino) on: November 22, 2012, 08:45:48 am
In order to start to ply with this project I've tried to upload the code as is, with the TX unit connected, but i'm getting a verify error on the code, I've looked through it but can't understand why it's having an issue with the array on line 121, error:

sketch_nov22a.ino: In function 'void sendOneSC2262Packet()':
sketch_nov22a:121: error: switch quantity not an integer
sketch_nov22a.ino: In function 'void loop()':
sketch_nov22a:270: error: incompatible types in assignment of 'char' to 'char [13]'.

Is anyone able to point me in the right direction?

Many thanks,
Stuart.
2  Using Arduino / Programming Questions / Using SDFat and how to count the number of mp3 files. on: March 01, 2012, 07:33:15 am
I'm playing with the sparkfun MP3 player Shield, with great success, but i need to be able to count the number of mp3 files on the SD card, does anyone know how to do this with using the SDFat library?

I'm using and Arduino Uno and the example code for the SFEMP3Shield at the moment for testing purposes.

Many thanks in advance,
Stuart.
3  Forum 2005-2010 (read only) / Interfacing / Re: NTP, UDP with Arduino 0019 on: December 05, 2010, 04:43:19 pm
I finally got it to compile correctly,

Thanks for your help.

I had an old install on my machine, in a compleatly diffrent directory who's which libary appears to have being read, removed this install and all is now ok.. thank god!

Now to have a play with storing data in the EEPROM and writing data to pachube too!

Thanks again,
Stuart.
4  Forum 2005-2010 (read only) / Interfacing / Re: NTP, UDP with Arduino 0019 on: December 05, 2010, 03:49:26 pm
List of files in the ethernet directory:

 Directory of C:\Users\Stuart\Documents\arduino-0021\libraries\Ethernet

02/10/2010  15:21    <DIR>          .
02/10/2010  15:21    <DIR>          ..
02/10/2010  15:21             3,074 Client.cpp
02/10/2010  15:21               713 Client.h
02/10/2010  15:21               881 Ethernet.cpp
02/10/2010  15:21               526 Ethernet.h
02/10/2010  15:21    <DIR>          examples
02/10/2010  15:21               666 keywords.txt
02/10/2010  15:21             1,851 Server.cpp
02/10/2010  15:21               369 Server.h
02/10/2010  15:21             5,051 Udp.cpp
02/10/2010  15:21             2,960 Udp.h
02/10/2010  15:21    <DIR>          utility
               9 File(s)         16,091 bytes
               4 Dir(s)   3,359,977,472 bytes free

Thanks Stuart.
5  Forum 2005-2010 (read only) / Interfacing / Re: NTP, UDP with Arduino 0019 on: December 05, 2010, 02:10:26 pm
Ok, so a fresh install of 0021 and a fresh download of the Time files, try to compile the code above and I get these errors again:

C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:30:19: error: types.h: No such file or directory
In file included from C:\Users\Stuart\Downloads\arduino-0021\libraries\SPI/SPI.h:15,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\/w5100.h:14,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:31:
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:17: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:16: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: declaration of C function 'long int random(long int)' conflicts with
c:/users/stuart/downloads/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:28: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: previous declaration 'long int random(long int)' here
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope

I am sure I am just doing something stupid here, but can't for the life of me see what it is???

TIA,
Stuart.
6  Forum 2005-2010 (read only) / Interfacing / Re: NTP, UDP with Arduino 0019 on: December 05, 2010, 12:52:11 pm
I suspect i am doing somthing stupid here, same errors using the above code:

C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:30:19: error: types.h: No such file or directory
In file included from C:\Users\Stuart\Downloads\arduino-0021\libraries\SPI/SPI.h:15,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\/w5100.h:14,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:31:
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:17: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:16: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: declaration of C function 'long int random(long int)' conflicts with
c:/users/stuart/downloads/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:28: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: previous declaration 'long int random(long int)' here
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope

Could this be as simple as I am missing the file types.h? as I can't see that one in the libraries directory?

Thanks and aplogies in advance,
Stuart
7  Forum 2005-2010 (read only) / Interfacing / Re: NTP, UDP with Arduino 0019 on: December 05, 2010, 04:32:27 am
Morning all,
Having followed the steps above i am still getting errors:

C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:30:19: error: types.h: No such file or directory
In file included from C:\Users\Stuart\Downloads\arduino-0021\libraries\SPI/SPI.h:15,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\/w5100.h:14,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:31:
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:17: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:16: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: declaration of C function 'long int random(long int)' conflicts with
c:/users/stuart/downloads/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:28: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: previous declaration 'long int random(long int)' here
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope

Aplogies if i have missed something obvious here, and thanks for your help in advance,
Stuart.
8  Forum 2005-2010 (read only) / Development / Re: Time Library added to Playground on: December 04, 2010, 05:20:46 pm
Thanks for your reply,
I've re-downloaded all the files shown on http://bitbucket.org/bjoern/arduino_osc/src/14667490521f/libraries/Ethernet/

Errors now look like this:
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:30:19: error: types.h: No such file or directory
In file included from C:\Users\Stuart\Downloads\arduino-0021\libraries\SPI/SPI.h:15,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\utility/w5100.h:14,
                 from C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:31:
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:17: error: declaration of C function 'uint16_t makeWord(byte, byte)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:16: error: previous declaration 'uint16_t makeWord(uint16_t)' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: declaration of C function 'long int random(long int)' conflicts with
c:/users/stuart/downloads/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:504: error: previous declaration 'long int random()' here
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:28: error: declaration of C function 'long int random(long int, long int)' conflicts with
C:\Users\Stuart\Downloads\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:27: error: previous declaration 'long int random(long int)' here
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'void UdpBytewiseClass::begin(uint16_t)':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:46: error: 'Sn_MR_UDP' was not declared in this scope
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp: In member function 'int UdpBytewiseClass::available()':
C:\Users\Stuart\Downloads\arduino-0021\libraries\Ethernet\UdpBytewise.cpp:55: error: 'getSn_RX_RSR' was not declared in this scope

So still a little stumped, but learning fast..
9  Forum 2005-2010 (read only) / Development / Re: Time Library added to Playground on: December 04, 2010, 03:54:56 pm
I am trying to use the Ethernet shield, and NTP but I'm having problems with the examples out of the box, with the following errors:


heating01.cpp.o: In function `write_n(int, int)':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:133: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:133: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:133: undefined reference to `UdpBytewiseClass::write(unsigned char)'
heating01.cpp.o: In function `getUlong()':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:123: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:123: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:123: undefined reference to `UdpBytewiseClass::read()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:124: undefined reference to `UdpBytewiseClass::read()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:125: undefined reference to `UdpBytewiseClass::read()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:126: undefined reference to `UdpBytewiseClass::read()'
heating01.cpp.o: In function `sendNTPpacket(unsigned char*)':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:106: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:106: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:106: undefined reference to `UdpBytewiseClass::begin(unsigned int)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:107: undefined reference to `UdpBytewiseClass::beginPacket(unsigned char*, unsigned int)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:108: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:109: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:110: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:111: undefined reference to `UdpBytewiseClass::write(unsigned char)'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:113: undefined reference to `UdpBytewiseClass::write(unsigned char)'
heating01.cpp.o:C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:114: more undefined references to `UdpBytewiseClass::write(unsigned char)' follow
heating01.cpp.o: In function `sendNTPpacket(unsigned char*)':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:118: undefined reference to `UdpBytewiseClass::endPacket()'
heating01.cpp.o: In function `getNtpTime()':
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:95: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:95: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:95: undefined reference to `UdpBytewiseClass::available()'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:97: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:97: undefined reference to `UdpBytewise'
C:\Users\Stuart\AppData\Local\Temp\build8924192961418854666.tmp/heating01.cpp:97: undefined reference to `UdpBytewiseClass::read()'

Having spent most of the day searching I've turned up nout.. Any help appreciated!

Stuart, newbie..
10  Forum 2005-2010 (read only) / Development / Re: Using alarmtime but scheduling from SD card on: December 16, 2010, 08:52:03 am
ooh, It's along time since I used Cron jobs.. prob 1998 at lucent tech..

Yes I suppose i am trying to do that, but you have given me an idea, If I had two schedules using the timealarm library
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263305457/30
 one for the current alarm and one for the next alarm, each time an alarm is run, it also reads the SD card to find the next alarm time and command and puts it into the schedule.

(apologies if I am not explaining the very well)

something like this:

on boot:
Read first alarm from schedule on SD card that is due to happen in the future, add this alarm and it's actions to ALARM 1

on ALARM 1 (based on time and Day of week)
Do action, Read next alarm from SD card  that is due to happen in the future, Change ALARM 2 to reflect the records time, DOW and actions.


on ALARM 2 (based on time and Day of week)
Do action, Read next alarm from SD card  that is due to happen in the future, Change ALARM 1 to reflect the records time, DOW and actions.


(This is all based on the idea that you can't change an alarm that's currently ringing, which may be incorrect, in which case only 1 ALARM is required)

Does that help?

TIA, Stuart.
11  Forum 2005-2010 (read only) / Development / Using alarmtime but scheduling from SD card on: December 15, 2010, 01:55:39 pm
I am working on a complex heating control system, and for version 2 I would like to use the alarm time function, but rather than have the schedule times hard coded I would like to pull them from an sd card, with a view to editing them from a webpage in future versions?

but after lots of googleing I cant see a way to read values from an sd card that effect the way the scheduled tasks run. This needs only be at boot up if they needed to be written to variables, but it would ideally be an unrestricted number of them (i.e. not coded to restrict to say 12 events)

Any help greatly appreciated.

I am using the Arduino Mega, and the Ethernet shield with an SD card slot.

Stuart.
Pages: [1]