Jump to content

magmalloy

EstablishedMember
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About magmalloy

  • Rank
    Newbrie
  1. ***NVM I resolved it by adding the libc.pic16.lib file to the project. ( I'm still getting an error when I try to convert an integer value being read from the ADC module into a float variable so it can be multiplied by another float. *EDIT if I define the adc input as a float in the beginning of my code, I'm still unable to process the multiplication (*also if I use float32_from_int32). Is this because of the number of bits it uses? float adcin; float adcbuffer; adcin = adc_measure(1)>>3; adcbuffer = float32_mul( adcin, 1.432 );
  2. So there is a way to do this? Phew ... Where could I find more information on the floating point library routines needed please?
  3. Hi I'm trying to do some maths in BoostC whereby I multiply an integer variable by a fixed decimal number, and I need to get an integer value as the product somehow (I'm not bothered about losing a bit of accuracy with that). I've tried some code using methods from here but it doesn't work. It was along these lines: int result; int variable; (int) result = variable * 0.433; or result = (int) (variable *0.433); ... and many variations thereof. How can I do this with BoostC? I get the following error message: Error: Unresolved external function:'__div_16_16(unsi
  4. It's a Futaba FP-S148 standard servo. ***EDIT Never mind I just had a bug in my code. Thanks for the reply anyway!
  5. Hi I'd like to write code for a PIC16f877a at 20MHz to move a servo according to an ADC input. Is it possible to position the servo arm so that it will move to a specified angle, from any previous position?
  6. Something like this should do what you want void ShowVal( int x ) { if( x < 0 ) x = 0; if( x > 99 ) x = 99; .... } Regards Dave Seems simple enough. Thanks will try it!
  7. Hi I need to convert a variable passed to a PIC to a two digit integer (between 0-99). How can I make sure a variable is no larger that 2 digits?
  8. I'll keep this as simple as possible: when coding in C using BoostC C Compiler, how can I calculate the parameters bit_time and uart_init parameters for 20Mhz on a PIC16F877A ?
×
×
  • Create New...