Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:31 18 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Converting other basic to Micromite Basic

Author Message
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 09:22am 19 May 2016
Copy link to clipboard 
Print this post

I'm "TRYING" to learn/work out the differences between the types of basic compared to Micromite Basic so I can convert Bascom and Picaxe programs if and when needed.

If anyone is able to help me, could you tell me what each of the lines below would be in Micromite Basic please?

[code]
'Data array for i2c communication
Dim Value_array (24) As Byte
Dim Ut As Long
Declare Sub I2c_write (byval Device_adres As Byte, byval Reg_adres As Byte, byval value As Byte)
Declare Function test1() As Long
Declare Function test2_64 () As Dword
Txt = Str (t)
Txt = format (txt, "00.00")

Sub I2c_read (device_adres As Byte, Reg_adres As Byte, Value_count As Byte)***
Local X As Byte (dim X As Byte????? can I miss out the Local bit???)
Local Y As Byte
Y = Value_count - 1

Shift Up, Left, 8
Up = Up + Value_array (2)

Local Var1 As Long
Local Var2 As Long
Local X As Long

Local Var1 As Double

Shift X, Right, 2, Signed

***************************
I2cstart
I2cwbyte Device_adres
I2cwbyte Reg_adres
I2cwbyte value
I2cstop
***************************
I THINK the last bit should be (not sure what cwbyte means though)
i2c open 400,1000 '400KHz bus speed
?
?
?
i2c close
[/code]

I can work out most of it myself, but the bits above I'm totally stuck on what they mean or would be in Micromite Basic
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1664
Posted: 01:14pm 19 May 2016
Copy link to clipboard 
Print this post

Bascom looks like it has 8 types of variables instead of the 3 in MMbasic.

So for BYTE, WORD, DWORD & LONG use INTEGER.
For SINGLE & DOUBLE use FLOAT.

Found some good stuff here.

Cheers

Phil
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1676
Posted: 08:54am 22 May 2016
Copy link to clipboard 
Print this post

Anyone else able to help?
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 12:23pm 22 May 2016
Copy link to clipboard 
Print this post

I don't know Bascom and don't know what device you are trying to talk to so I can only guess.

I2cwbyte is probably short for
I2C WRITE BYTE

In MMBasic, I would try
I2C WRITE Device_adres, 1, 2, Reg_adres, value


Jim
VK7JH
MMedit   MMBasic Help
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024