Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 16:21 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 : LCD with 4.5

Author Message
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 12:21pm 31 May 2014
Copy link to clipboard 
Print this post

Hi I was reading the manual on the V 4.5 for the maximite,I want to read voltage on a pin.
The manual has this example
LCD INIT 2, 3, 4, 5, 23, 24
LCD 1, 2, "Temperature"
LCD 2, 6, STR$(DS18B20(15))

to read voltage or data on pin 5 would I just go
LCD 2, 6, STR$(5)
Sorry if you have answered it before
Thank you
Martin
Heppy
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 12:57pm 31 May 2014
Copy link to clipboard 
Print this post

First, you have to set the pin to analogue in

SETPIN 5, AIN

then use

LCD 2, 6, STR$(PIN(5))


You may want to format the output before displaying it.


Jim


VK7JH
MMedit   MMBasic Help
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 01:02pm 31 May 2014
Copy link to clipboard 
Print this post

Thanks
will it refresh automatic ,or do I need code to keep looping the pin?

Heppy
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 02:13pm 31 May 2014
Copy link to clipboard 
Print this post

Yes, you would need to have a loop of some sort.
It's up to you to decide how often you want to update the display.

Jim
VK7JH
MMedit   MMBasic Help
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 04:37pm 31 May 2014
Copy link to clipboard 
Print this post

If you're using pin 5 as part of the LCD data-lines, can you also use it to measure the analog voltage at the same time?

Maybe you can, but I thought that once it is taken by the LCD routine, it is reserved for that command until you issue an LCD CLOSE command to release the pins.
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 05:33pm 31 May 2014
Copy link to clipboard 
Print this post

You are right Grogster, I didn't notice that in the original code.
Having an analogue input feeding the same pin that talks to the LCD would be a problem.

Jim
VK7JH
MMedit   MMBasic Help
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 08:56pm 31 May 2014
Copy link to clipboard 
Print this post

Thanks Pin 5 was just a example (I will use pin 6 and 7)I would like to monitor my O2 sensors on my engine

Heppy
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 12:14am 10 Jun 2014
Copy link to clipboard 
Print this post

Hi I bought my LCD,went to wire it up ,but I gather D4 to D7 got to pins 2 to 5,but the RS and EN ,I don't have a pin 23 and 24 on my org maximite?
Can anyone help me?
Thanks Martin
Heppy
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:05am 10 Jun 2014
Copy link to clipboard 
Print this post

Use any pin you like/have available.
You then use LCD INIT with the pin numbers you connected to the LCD , that will tell the firmware how to control the LCD.

Edited by TZAdvantage 2014-06-11
Microblocks. Build with logic.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2294
Posted: 07:21am 10 Jun 2014
Copy link to clipboard 
Print this post

  heppy36 said  
I don't have a pin 23 and 24 on my org maximite?


does the maximite have commands built in to drive an HD44780 LCD? i thought only the micromite had the LCD commands built in, and that with the maximite you had to put together your own routines - not that it is too difficult.

rob :-)
 
BobD

Guru

Joined: 07/12/2011
Location: Australia
Posts: 935
Posted: 07:43am 10 Jun 2014
Copy link to clipboard 
Print this post

V4.5 of MMBasic for the Maximite introduced the LCD command as well as many or all of the features from the Micromite.
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 11:50pm 10 Jun 2014
Copy link to clipboard 
Print this post

Thank you ,I made 11 and 12 the rs and e
And it worked great,I was just measuring 0 to 1 Volt on pin 7

40 SETPIN 7,AIN
50 LCD INIT 2, 3, 4, 5, 11, 12
60 LCD 1, 2, "O2 Voltage"
70 LCD 2, 6, STR$(PIN(7))
80 print "O2 Level is" pin(7)
90 pause 500
100 goto 70
Heppy
 
heppy36

Regular Member

Joined: 29/07/2011
Location: Australia
Posts: 54
Posted: 08:30am 11 Jun 2014
Copy link to clipboard 
Print this post

Hi can anyone tell me the command to clear the LCD ,before next read
Thanks again Martin
Heppy
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 09:20am 11 Jun 2014
Copy link to clipboard 
Print this post

LCD CLEAR will erase all data displayed on the LCD
 
Print this page


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

© JAQ Software 2024