Well after redoing, downloading, extracting all required files and saved in different location as per Tumblweeds suggestion
HUSTON WE HAVE LANDED
It now compiles and actually works!
Thanks all that helped. My grandson will love this "toy"
Need to eliminate several tunes in the example as per wife's wishes.
For anyone playing at home, if you want to try it using the free Swordfish SE compiler and the 18F43K22,
you can change the chip in the xxxx_example.bas programs....
rtttl_example.bas:
Code:
program RTTTL_example
device = 18F43K22 // <<<<<< CHANGED TO COMPILE FOR 18F43K22
clock = 64
// int osc and IO pin libraries
include "intosc.bas"
#option DIGITALIO_INIT = true // automatically call setalldigital
#option DIGITALIO_SLEWRATE = 1 // 1=slow (we don't need fast edges)
include "setdigitalio.bas"
// tone library
// specify output pin
#option TONE_OUTPUT_PIN = PORTD.7 // <<<<< 18F43K22 PORTD OUTPUT PIN
include "tone.bas"
If you try to compile the tone_example.bas, you'll have to change one declaration so it'll fit the SE version RAM limit of 256 bytes...
About half-way down the page in tone_example.bas, change the note_list array size
Code:
// note list in ram (freq, duration pairs)
dim note_list(32*2) as word // <<<<<< change for SE version
main:
The Swordfish "Special Edition" is the free version of Swordfish Basic. It's extremely generous in its limitations to the point that many users never upgrade to the paid version (perhaps a bit too generous!).
If you've ever used Visual Basic, Swordfish will be very familiar. Don't take MrDEB's trials and tribulations as a reflection on the language. I find Swordfish easy to use and it compiles fast, efficient code.
I found I had to change the 18f23k22 to 18f43k22 to be able to compile.
Am using the paid version of SF.
And yes to what Visitor said.
now to edit the code to turn on LEDS per notes of melody and put the auto turn off to monitor portB.
Last mentioned, your board has 8 LEDs and 8 switches.
Do you want to use the switches to play songs using the RTTTL player, or just use the tone module to play a different note (and LED) for each switch press? Or something else?
If you're using the RTTTL player you can get the name of the tune using rtttl.get_name() and put it on the LCD.