​ ​ ​ ​ Advice needed for taking input from 53 LDRs.. - Page 7
Page 7 of 8 FirstFirst ... 5 6 7 8 LastLast
Results 61 to 70 of 74

Thread: Advice needed for taking input from 53 LDRs..

  1. #61
    Senior Member
    Join Date
    Apr 2014
    Location
    UK
    Posts
    210

    Default

    That is super fast. I set frames/ sec to 100, still runs.
    If I tick 'no timer' I get 'Not Responding', higher processor load and sluggish response to input like the tickbox etc.
    If this line:

    For Y = 0 To screenshot.Size.Height / 2 - 1

    was changed to just

    For Y = 0 To screenshot.Size.Height

    would it still work as well?

    Also, I'll add 'N' to the list of variables to print to screen, so line 102 becomes

    Me.Text = "Y=" & Y & " N=" & N

    Unfortunataely I can't test these so far, as I just can't find a 'Run' button on VS... duh! Where is it? Assuming one exists... I googled this, the first 5 results didnt work for me.

    Did my last post on here make any sense?

    Good to see it can work so fast, much respect to you for that, and to VB, which I will now no longer refer to as 'slow'...

    AS ever, very grateful for the time and thought you are putting into helping me.

  2. #62
    Senior Member
    Join Date
    Sep 2011
    Location
    Montpellier (FRANCE)
    Posts
    2,794

    Default

    Quote Originally Posted by moorea21 View Post
    That is super fast. I set frames/ sec to 100, still runs.
    If I tick 'no timer' I get 'Not Responding', higher processor load and sluggish response to input like the tickbox etc.
    Use this option only with out to file.
    To stop it, keep clicking to the "no timer" button.
    It will take 500 loops to react. You can down this to 50.
    Code:
                    If I > 50 Then
                        System.Windows.Forms.Application.DoEvents()
                        I = 0
                    End If
    Quote Originally Posted by moorea21 View Post
    If this line:
    For Y = 0 To screenshot.Size.Height / 2 - 1

    was changed to just

    For Y = 0 To screenshot.Size.Height-1

    would it still work as well?.
    OUPS : was a test, but forget to remove it... You are quasi-true !
    But there are screenshot.Size.Height pixels starting from zero to screenshot.Size.Height -1
    It will work better !
    Quote Originally Posted by moorea21 View Post
    Unfortunataely I can't test these so far, as I just can't find a 'Run' button on VS... duh! Where is it? Assuming one exists... I googled this, the first 5 results didnt work for me.
    Demarrer.jpg
    This is a French VS, but symbol is same.
    You can also use F5 key.
    You can also run ...\Violin\Violin\bin\Debug\violin.exe
    Quote Originally Posted by moorea21 View Post
    Did my last post on here make any sense?
    YES, but IMHO it's better to send only one byte, and use EEPROM on the Picaxe to get 12 bits of data.
    Last edited by BESQUEUT; 12-03-2018 at 22:06.
    There are 10 types of people in the world: those who understand binary, and those who don't.

  3. #63
    Senior Member
    Join Date
    Apr 2014
    Location
    UK
    Posts
    210

    Default

    Okay, EEPROM it is then.

    I pressed F5 and nothing happened. I'll try again tomorrow, anyway.

  4. #64
    Senior Member
    Join Date
    Apr 2014
    Location
    UK
    Posts
    210

    Default

    I'm trying to test the VS 'solution' (rather than the exe) with an 08m2 using C.4 as serin.

    As far as I can tell, I've correctly wired the new serial port (with same type of jackplug as used to program a picaxe,) and I think I understand how the VS code to send serial data works (line 100 etc, from 'B(0) = N'), but nothing is appearing on my LCD screen when this is loaded onto the picaxe:-

    Code:
    'Put value of 'N' onto LCD, from VS Violin, via AXE027 on COM3
    'Serin is C.4, pin 3 on chip
    'Serout for LCD is C.1, pin 6 on chip
    'No serout pin wired for jackplug yet
    #picaxe 08m2
    
    init:
    	pause 300
    	serout C.1,N2400,(254,1)
    	pause 50
    	serout C.1,N2400, (254,128)	'put on start of 1st line
    	'serout C.1,N2400, ("testing")
    	pause 50
    	
    main:
    	serin C.4,N2400,b1
    	serout C.1,N2400, (254,128)
    	serout C.1,N2400, (#b1)
    	pause 4
    	goto main

    Baud rate of VS program and picaxe both set to 2400, frames/s at 20, 'Out on serial' is ticked, both VS and picaxe IDE set to COM3, LCD works fine, jumper for 08m2 set to 'OUT'.

    I was hoping this (below) could be used as simplest test of whether my serial port is able to receive data:-

    Code:
    Sub testSerial(ByVal test As String)
        test = "TEST"
        Using com3 As IO.Ports.SerialPort = 
                My.Computer.Ports.OpenSerialPort("COM3")
                com3.WriteLine(test)
        End Using
    End Sub
    but creating a 'project' out of this code is not like in VB6 (no surprise.) Would that be something you could put together quite easily and send? If its no trouble.

  5. #65
    Senior Member
    Join Date
    Sep 2011
    Location
    Montpellier (FRANCE)
    Posts
    2,794

    Default

    Can you test with a serial terminal like realterm ?
    There are 10 types of people in the world: those who understand binary, and those who don't.

  6. #66
    Senior Member
    Join Date
    Apr 2014
    Location
    UK
    Posts
    210

    Default

    I'll give it a go.

  7. #67
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    24,340

    Default

    It's always best to start as simple as possible. In this case a PC program which just sends an "X" or other character, have the PICAXE set a LED which indicates what was expected has been received. Then move up to other characters, multiple characters if required, then variable data.

  8. #68
    Senior Member
    Join Date
    Sep 2011
    Location
    Montpellier (FRANCE)
    Posts
    2,794

    Default

    Quote Originally Posted by moorea21 View Post
    I'll give it a go.
    If ok with terminal, click the "open" button. It must become "close". If not, port IS not correctly opened.
    There are 10 types of people in the world: those who understand binary, and those who don't.

  9. #69
    Senior Member
    Join Date
    Apr 2014
    Location
    UK
    Posts
    210

    Default

    All working now! I had to tick 'Out on Screen' as well as 'Out on Serial', as the code for writing to the port is under 'If chkScreen.Checked' not 'If chkSerial.Checked'.

    There was a slight glitch with my picaxe software; when N <10 (ie in single figures) the value of N on the lcd screen seemed to be 10*N (ie N =9 but lcd says 90.) But it turned out that the '0' was just left over from when b1 had equalled 10.

    Next step will be to take 'N' and end up with max7219 address/data and actually light some leds, then work out how to send serial to another picaxe which can have its clock frequency changed for making different notes on pwm; can't do that on the same picaxe that receives serial input, as the baud rate will go out the window.

    And then the minor matter of building the 'instrument' itself...

  10. #70
    Senior Member
    Join Date
    Sep 2011
    Location
    Montpellier (FRANCE)
    Posts
    2,794

    Default

    Quote Originally Posted by moorea21 View Post
    All working now! I had to tick 'Out on Screen' as well as 'Out on Serial', as the code for writing to the port is under 'If chkScreen.Checked' not 'If chkSerial.Checked'..
    OUPS : bad copy/paste...
    It is preferable to correct code and not check out on screen...
    Code:
            If chkSerial.Checked Then
                With SerialPort1
                    B(0) = N
                    If .IsOpen Then .Write(B, 0, 1)
                End With
            End If
    
            If chkScreen.Checked Then
                Me.Text = "Y=" & Y & " N=" & N
            End If
    Last edited by BESQUEUT; 14-03-2018 at 15:49.
    There are 10 types of people in the world: those who understand binary, and those who don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •