navitron
 
Renewable Energy and Sustainability Forum
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: Navitron Partners With Solax to Help Create A More Sustainable Future | Navitron Calls for Increased Carbon Footprint Reduction In Light of Earth Overshoot Day | A plea from The David School - Issue 18
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: arduino programming  (Read 3489 times)
Ivan
Hero Member
*****
Offline Offline

Posts: 2262


« on: December 05, 2010, 02:42:28 AM »

KenB et al,

I've got myself a 328Atmega duemilanove with the nuelectronics nokia 3310 display and the realtime clock/SD card shield.

I've downloaded the nokia display library,but am struggling to understand how to create menu systems. I've attached my slightly modified version of the demo sketch provided in the nuelectronics download. (Both the .h and .pde files have been renamed to .txt so that they can be uploaded to the forum)

Can anyone help me produce the menu system described below:


***************************************
Main Page

LINE 1: [The current Time from realtime clock]
LINE 2: "Mst Vnt Lit Ht"
LINE 3:  OFF OFF OFF ON (ie status of relays 1 - 4)
Line 4: "Temp. Humidty"
Line 5:   21C    95%   (ie reading of temperature sensor; reading of humidity sensor)

(Click any button to exit main page and enter Top menu system)


*****************************
TOP MENU PAGE (user can scroll through menu, selected title is highlighted. Click centre key on joystick to reach required submenu)

LINE 1:SET MIST
LINE 2:SET Ventilation
LINE 3:SET Temperature
LINE 4:SET Light


Exits to main page after 30seconds without keystroke

******************************
SET MIST PAGE

LINE 1: 'SET MISTING'
Line 2: "On Time"   (using the joystick left/right buttons, toggles Variable[vent] through 0.25, 0.5, 1, 2, 3, 4, 5, 10, 15, 20)
Line 3:   [mist] 'min'
Line 4: 'No.of Cycles/hr'  
LINE 5:     [cyc] times  (using the joystick left/right buttons, toggle between 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)

Line 6: OK (If clicked, returns user to Top Menu Page)  

nb variable [cyc] can be changed within the MIST or VENT pages
*******************************
SET VENT PAGE (the joystick up/down key toggles between highlighting line3, line5 and line6)
LINE 1: 'SET VENTILATION'
LINE 2: 'Vent On Time'
Line 3:   [vent] 'min'        (using the joystick left/right buttons, toggles Variable[vent] through 0.25, 0.5, 1, 2, 3, 4, 5)
Line 4: 'No.of Cycles/hr'  
LINE 5:     [cyc] times  (using the joystick left/right buttons, toggle between 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)

Line 6: OK (If clicked, returns user to Top Menu Page)
********************************

SET TEMP PAGE

LINE 1:  'SET TEMPERATURE'
Line 2:   'Min. Temp'
Line 3:    [Tmin] C   (using the joystick left/right buttons, toggles Variable[TminC] through 0 - 30C)
Line 4: 'Max. Temp'
Line 5:    [Tmax] C   (using the joystick left/right buttons, toggles Variable[TminC] through 0 - 30C, maintaining at least 1C hysteresis above [Tmin])

Line 6: OK (If clicked, returns user to Top Menu Page)
********************************
SET Light PAGE

LINE 1:  'Set Diurnal period'
Line 2:    [diurnal] 'hrs'   (using the joystick left/right buttons, toggles Variable[diurnal] through 20,21,22,23,24,25,26,27,28 )
Line 4: 'SET daylength'
Line 5:    [day] hrs   (using the joystick left/right buttons, toggles Variable[day] through 8,9,10,11,12,13,14,15,16,17,18)

Line 6: OK (If clicked, returns user to Top Menu Page)
********************************

* environ_controller.txt (6.33 KB - downloaded 536 times.)
* avr_bmp.txt (0.96 KB - downloaded 254 times.)
Logged

www.epogee.co.uk - Solar PV & Solar Thermal Training / MCS
johnrae
Hero Member
*****
Offline Offline

Posts: 764


« Reply #1 on: December 05, 2010, 10:28:38 AM »

Have you tried addressing your enquiry to the Arduino forum membership.  There's lots of very knowledgable responders there - and a few sarcastic ones to boot

http://www.arduino.cc/forum

jack
« Last Edit: December 05, 2010, 10:31:15 AM by johnrae » Logged
KenB
Hero Member
*****
Offline Offline

Posts: 2694


Energy Self Enlightenment


WWW
« Reply #2 on: December 05, 2010, 07:03:47 PM »

Hi Ivan,

Welcome to the fascinating and initially frustrating world of the Arduino.

May I suggest that you initially just fit the Nokia display shield to the Arduino and download the example from the NuElectronics website.

The .pde file is the source code file in the format used in the Arduino programming environment, and the  .h files are header files or library files which contain code specifically needed to exercise the hardware - ie the display shield.

When you download the Nokia example, it will give you a directory called Nokia_3310_lcd which you must load into the libraries directory of the Arduino IDE.  This nokia library contains about 7 files including some .h and some .cpp files. There is also an Examples subdirectory which contains the actual Nokia_3310_menu sketch.

See if you can get to the stage where you can get this sketch to run as-is on the Arduino. Then you will be able to trace through the code and see what functions are used to print text strings to the various lines in the Nokia display.

I will get the same thing running here - so that we can exchange sketches as .pde files - so what runs on mine, should run on yours - BUT you have to get the support libraries into the correct directory first. Then we will have a common starting point from which to proceed.


regards,


Ken
« Last Edit: December 05, 2010, 07:05:25 PM by KenB » Logged
KenB
Hero Member
*****
Offline Offline

Posts: 2694


Energy Self Enlightenment


WWW
« Reply #3 on: December 05, 2010, 07:07:46 PM »

Ivan,

Ignore what I just wrote, you are clearly at stage 2.  Perhaps I should have first read your post more thoroughly.

I will look at what you want to print to the menu display and get back  to you.


Head full of gasifiers today - affects the ability to comprehend written English


Ken
Logged
wyleu
Guest
« Reply #4 on: December 21, 2010, 08:21:52 PM »

  Perhaps I should have first read your post more thoroughly.


... that's got to be worth a smite...
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!