Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:43 07 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 : Maximite issue

Author Message
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 08:56pm 01 Feb 2016
Copy link to clipboard 
Print this post

I wrote the programme below in order to test the Maximite interface hardware that I designed & built.

It is intended to light LEDs in sequence - LED1 for 3 seconds, then LED1 goes off & LED2 lights, etc.

But, when I ran the programme, all LEDs remained dark. So I removed the interface & connected my DMM to one of the outputs. But the voltage remains at 0 when the appropriate output is supposed to be high.

I can't see anything wrong with the programme.

I ran the datalog.bas programme. It detects & displays the voltage at each of the pins 1 ~ 10. So I don't think there is anything wrong with the Maximite.

Any assistance will be appreciated.

100 FOR i = 1 TO 20 : SETPIN i, DOUT : NEXT i 'DOUT or 8 for digital outputs
110 'Pins 1 ~ 20 digital outputs
120 PRINT "Start" : PRINT
130 For i=1 to 20
140 PIN(i)=1
150 PRINT i,
160 Pause 3000
170 PIN(i)=0
180 NEXT i
190 PRINT "Stop"
200 end




 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 09:05pm 01 Feb 2016
Copy link to clipboard 
Print this post

I don't think you can use the setpin command in a loop like that, can you?

IE: You have to define your setpin commands separately, one after another.
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5914
Posted: 09:19pm 01 Feb 2016
Copy link to clipboard 
Print this post

What version of MMBasic are you using?

Line numbers suggests an early version.

DOUT was only introduced in later versions so try
100 FOR i = 1 TO 20 : SETPIN i, 8 : NEXT i 'DOUT or 8 for digital outputs


Jim


VK7JH
MMedit   MMBasic Help
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 11:34pm 01 Feb 2016
Copy link to clipboard 
Print this post

  TassyJim said   What version of MMBasic are you using?

Line numbers suggests an early version.

DOUT was only introduced in later versions so try
100 FOR i = 1 TO 20 : SETPIN i, 8 : NEXT i 'DOUT or 8 for digital outputs


Jim


Thanks Jim,
That worked. I have MM Version 2.7B. I have not used the MM for about 2 years.

Thanks for the responses.

Len
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1135
Posted: 01:40am 02 Feb 2016
Copy link to clipboard 
Print this post

Hi Len,

  Quote   I have MM Version 2.7B.


I strongly recommend the latest MMBasic version (4.5). It's very easy to update.

Regards
Michael
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 12:36pm 02 Feb 2016
Copy link to clipboard 
Print this post

  twofingers said   Hi Len,

  Quote   I have MM Version 2.7B.


I strongly recommend the latest MMBasic version (4.5). It's very easy to update.

Regards
Michael

Thanks Michael,
I have downloaded the 4.5 version. I'll install it shortly.
Regards, Len
 
Print this page


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

© JAQ Software 2024