How to check if a number is an integer with Mikrobasic pro

General discussion on mikroElektronika website & forums.
Post Reply
Author
Message
David777
Posts: 26
Joined: 19 Sep 2014 20:01

How to check if a number is an integer with Mikrobasic pro

#1 Post by David777 » 27 Mar 2017 13:34

Hi Guys
I'm trying to convert a byte into a binary string that I can send to a shift register.
I know how to send the data with Data Clock Latch ect but don't know how to covert the byte.
I thought I could divide the byte by two and if I have a remainder I send logic 1 and if I don't I send logic 0
but don't know how to check if I have a remainder or know.
Any help would be appreciated thanks in advance.

David

User avatar
danilo.milovic
mikroElektronika team
Posts: 501
Joined: 05 Dec 2016 14:59

Re: How to check if a number is an integer with Mikrobasic p

#2 Post by danilo.milovic » 28 Mar 2017 10:12

Hi,

what compiler are you using?

You can use our Conversions Library, or to be more precise ByteToStr

http://download.mikroe.com/documents/co ... #bytetostr

Regards,

Danilo

David777
Posts: 26
Joined: 19 Sep 2014 20:01

Re: How to check if a number is an integer with Mikrobasic p

#3 Post by David777 » 28 Mar 2017 22:28

Thanks for quick reply I'm using Mikrobasic Pro with Pro for Pic Security USB stick.
Not quite sure how to implement the library for what I require but I will see if I can make it work now I know what I need to look at.
Thanks
David

Post Reply

Return to “Website & Forums General Discussion”