User Activity

  • Posted a comment on discussion Open Discussion on GCBASIC

    LCD_DB6 and LCD_DB7 are duplicated, and there is no LCD_DB4 or LCD_DB5. #DEFINE **LCD_DB7** PORTB.5 #DEFINE LCD_DB6 PORTB.4 #DEFINE **LCD_DB7** PORTB.3 #DEFINE LCD_DB6 PORTB.2 Later, Clint

  • Posted a comment on discussion Open Discussion on GCBASIC

    This is incorrect in the help file: Example: #DEFINE LCD_IO 4 #DEFINE LCD_SPEED OPTIMAL #DEFINE LCD_DB7 PORTB.5 #DEFINE LCD_DB6 PORTB.4 #DEFINE LCD_DB7 PORTB.3 #DEFINE LCD_DB6 PORTB.2 #DEFINE LCD_RW PORTA.3 'Must be defined for RW Mode #DEFINE LCD_RS PORTA,2 #DEFINE LCD_ENABLE PORTA.1 It should be more like: Example: #DEFINE LCD_IO 4 #DEFINE LCD_SPEED OPTIMAL #DEFINE LCD_DB7 PORTB.5 #DEFINE LCD_DB6 PORTB.4 #DEFINE LCD_DB5 PORTB.3 #DEFINE LCD_DB4 PORTB.2 #DEFINE LCD_RW PORTA.3 'Must be defined for...

  • Posted a comment on discussion Compiler Problems on GCBASIC

    The following program will compile and progam properly under GCBASIC but not GCStudio. #chip 18F14K22 #define USART_BAUD_RATE 9600 #define USART_TX_BLOCKING Do HSerSend “A” Wait 100 ms Loop Later, Clint

  • Posted a comment on discussion User Submitted Projects, Demos & Guides on GCBASIC

    This probably isn't the right place to explain this but... gcb does sin and cos by lookup tables. Integer math isn't really that hard. You do have to know what the min and max of the number you expect to end up with, and then you can make it fit in a long variable with a decimal point assumed. (e.i. 1235234 = 123.5234) 4 decimal points assumed. Say for instance you need to divide x by 1.32, you would first ([long]x * 10000) / 132. Your answer would have an assumed 2 decimal places. 90/1.32 = (90...

  • Posted a comment on discussion User Submitted Projects, Demos & Guides on GCBASIC

    I'm using this for retrieving a single precision value from a sensor. I really need to rename my variables, they aren't named right. The fractional name should be mantissa and the mantissa should be exponent. :( I too am a little new at the float/single/double precision game. I'm too use to integer math on these microcontrollers I program with gcbasic. It has worked well for me. Later, Clint

  • Posted a comment on discussion User Submitted Projects, Demos & Guides on GCBASIC

    I will be glad to look at it. I did make a mistake that I have corrected. I divided by 0xFFFF and it should have been 0x10000. Later, Clint

  • Modified a comment on discussion User Submitted Projects, Demos & Guides on GCBASIC

    I needed to convert a single precision number to a integer value. This is what I came up with. You lose a little precision but that happens anyway when dealing with integer math. sub SingleToLong(sgn as Byte, fnx as long, prec as byte) '----------------------------------------------------- ' sgn - the sign is returned in this variable ' fnx - single precision in, long variable out ' prec - number of digits of precision (e.i. 3 = 1000) '----------------------------------------------------- dim fractional...

  • Posted a comment on discussion User Submitted Projects, Demos & Guides on GCBASIC

    I needed to convert a single precision number to a integer value. This is what I came up with. You lose a little precision but that happens anyway when dealing with integer math. sub SingleToLong(sgn as Byte, fnx as long, prec as byte) '----------------------------------------------------- ' sgn - the sign is returned in this variable ' fnx - single precision in, long variable out ' prec - number of digits of precision (e.i. 3 = 1000) '----------------------------------------------------- dim fractional...

View All

Personal Data

Username:
ckoehn
Joined:
2012-12-11 00:56:13

Projects

This is a list of open source software projects that Clint Koehn is associated with:

  • Project Logo GCBASIC   Last Updated:

Personal Tools