![]() |
Forum Index : Microcontroller and PC projects : Maximite issue
Author | Message | ||||
larny Guru ![]() Joined: 31/10/2011 Location: AustraliaPosts: 346 |
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 ZealandPosts: 9584 |
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: AustraliaPosts: 6264 |
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 |
||||
larny Guru ![]() Joined: 31/10/2011 Location: AustraliaPosts: 346 |
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: GermanyPosts: 1566 |
Hi Len, I strongly recommend the latest MMBasic version (4.5). It's very easy to update. Regards Michael causality ≠ correlation ≠ coincidence |
||||
larny Guru ![]() Joined: 31/10/2011 Location: AustraliaPosts: 346 |
Thanks Michael, I have downloaded the 4.5 version. I'll install it shortly. Regards, Len |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |