![]() |
Forum Index : Microcontroller and PC projects : LCD with 4.5
Author | Message | ||||
heppy36![]() Regular Member ![]() Joined: 29/07/2011 Location: AustraliaPosts: 54 |
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: AustraliaPosts: 6220 |
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 |
||||
heppy36![]() Regular Member ![]() Joined: 29/07/2011 Location: AustraliaPosts: 54 |
Thanks will it refresh automatic ,or do I need code to keep looping the pin? Heppy |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6220 |
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 |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9489 |
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: AustraliaPosts: 6220 |
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 |
||||
heppy36![]() Regular Member ![]() Joined: 29/07/2011 Location: AustraliaPosts: 54 |
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: AustraliaPosts: 54 |
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: ThailandPosts: 2209 |
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. Microblocks. Build with logic. |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2400 |
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: AustraliaPosts: 935 |
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: AustraliaPosts: 54 |
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: AustraliaPosts: 54 |
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 ZealandPosts: 711 |
LCD CLEAR will erase all data displayed on the LCD |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |