Search found 401 matches

by Steven
Sun Feb 01, 2009 4:53 pm
Forum: Modules
Topic: Sin and Cos problem
Replies: 2
Views: 3098

I think that the sin and cos functions are expecting an angle in radians, not degrees. To convert from degrees to radians, multiply your angle by 2Pi/360 (or approx 0.0174533).
by Steven
Sun Feb 01, 2009 10:20 am
Forum: User Modules
Topic: 18F26K20 SD Testing
Replies: 55
Views: 38576

I've just posted a partly updated version of the help file for the SD module on the wiki ( http://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.SDFileSystemVersion ), with my benchmark figures in. The figures in the above post are from an earlier version of the module and it's worth upgrading...
by Steven
Sun Feb 01, 2009 10:03 am
Forum: General
Topic: Useful USB HID stuff
Replies: 1
Views: 2697

That's really helpful - thanks.
by Steven
Sun Feb 01, 2009 10:02 am
Forum: IDE
Topic: Code Explorer Variables not listing
Replies: 2
Views: 3236

There is a fundamental difference between variables declared at the start of the code and those declared within subroutines/functions. Those at the beginning are global - they are accessible by all code within a module or program, and outside of a module also if they are made public. Variables decla...
by Steven
Thu Jan 22, 2009 9:45 pm
Forum: Modules
Topic: SI2C Query
Replies: 6
Views: 5127

Good to know it's been of use - thanks for letting me know.
by Steven
Thu Jan 22, 2009 6:41 pm
Forum: User Modules
Topic: Finding location of first cluster of file on SDCard
Replies: 7
Views: 5597

In answer to (1), you will have to find the file entry in the root directory (these are a specified number of sectors near the start of the disk). The file entry will tell you the first cluster of the file. You will then need to convert this to a sector number (the first available cluster is number ...
by Steven
Thu Jan 15, 2009 6:50 pm
Forum: User Modules
Topic: Returning a 256 Byte Array from a User Module
Replies: 4
Views: 3969

Could you pass the array by reference? I'll have to check this.
by Steven
Fri Jan 09, 2009 7:46 pm
Forum: User Modules
Topic: 18F26K20 SD Testing
Replies: 55
Views: 38576

Hi Ryan,

No, I haven't used a 18F26K20 yet. Are the SPI registers standard or are they named differntly maybe?
by Steven
Fri Jan 09, 2009 7:47 am
Forum: User Modules
Topic: Smallest file size possible on SDCard in FAT16?
Replies: 2
Views: 2968

Why not switch to writing using FAT - the library by itself, run on a 40MHz PIC could write 6MB in less than 2 minutes. Or maybe there is something that we could do to speed up your code - can you post it?
by Steven
Wed Jan 07, 2009 4:21 pm
Forum: Compiler
Topic: 18F8722 Extended Microcontroller mode...
Replies: 12
Views: 9395

I don't know anything about using extended mode, but you might be able to create a structure that contains your variables and then place a declared instance of this using an absolute address. The storage of strucures is in sequential bytes normally.

And welcome to the forum!
by Steven
Mon Dec 29, 2008 4:39 pm
Forum: User Modules
Topic: FAT or FAT32
Replies: 4
Views: 4047

Hi - could you post the code that you are using?
by Steven
Thu Dec 11, 2008 4:09 pm
Forum: Compiler
Topic: DS18S20
Replies: 4
Views: 2985

It might not be the answer, but try putting the dims after the includes.
by Steven
Sun Nov 30, 2008 3:53 pm
Forum: Modules
Topic: Anyone has built 7 segment LED display module?
Replies: 4
Views: 3833

Dave has posted some code on the wiki: http://www.sfcompiler.co.uk/wiki/pmwiki ... r.SegCount
by Steven
Thu Nov 27, 2008 7:40 am
Forum: Compiler
Topic: LCD formatting...
Replies: 9
Views: 5522

Something like this might also help:

Code: Select all

Function GetNumber(pSwitches as Word) as Byte
Dim i as Byte
   GetNumber = 0
   i = 0
   Repeat
      Inc(i)
      If pSwitches.0 = 1 Then
         GetNumber = i
      EndIf
      pSwitches = pSwitches >> 1
   Until i = 16 or GetNumber > 0
End Function
by Steven
Mon Nov 24, 2008 10:52 pm
Forum: Compiler
Topic: LCD formatting...
Replies: 9
Views: 5522

I think

LCD.WriteAt (1, 1, BinToStr(Switches))

should work fine, as you suggest - nothing else should be needed and no need to dim an extra string to hold it.