Announcement

Collapse
No announcement yet.

Gs500

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Alrighty, let's take a look-see here. I don't know if the forum or the act of cutting and pasting is messing up the indentation here, but be absolutely sure to keep your indentation and whitespace consistent in your editor. It makes many kinds of simple bugs _much_ easier to see right away. Use either tabs or spaces for indentation, never both.

    [code]
    { // If the "in" = 0 , As in I sent 0 from my phone, do the
    [/code]Seem to be missing the "if" statement on this line?

    [code]
    analogWrite (ledpin, 0150);
    [/code]Typo! You meant "150". But prefixing a number with a 0 tells the compiler to treat it as an octal number. 150 in octal is 226 in decimal!

    But the problem is that I can sent anything from 0-9 and the arduino recognizes that and does what I want.

    But what if I wanted to send something like "Light on"
    That's because you've declared "in" to be of type "int", which is an integer. "Light on" however, is a string. Or in C-speak, an array of chars. What's probably happening is that "L" is getting stored in "in" and the rest is lost. (You can store a char into an int because an int is a larger data type. The compiler automatically does the conversion between the character "A" and it's numerical representation.)

    The Serial.read() (http://arduino.cc/en/Serial/Read) function only returns one byte at a time. If you want to receive a string instead, you need to declare a character array and then use Serial.readBytes() or Serial.readBytesUntil() to read the bytes into it. See this for quick primer on dealing with strings: http://arduino.cc/en/Reference/String

    Personally, I'd just toss integers around and be done with it. But I guess depending on the abilities of the application on your phone, you may have to deal with strings. It's a bit of a learning curve, but not bad once you get the hang of it.

    And don't get discouraged if this programming business seems a little daunting. It is hard. You're actually doing really well!
    Last edited by eil; 05-15-2013, 05:02 PM.
    Charles
    --
    1979 Suzuki GS850G

    Read BassCliff's GSR Greeting and Mega-Welcome!

    Comment


      Here is a page about exactly what you're trying to do: http://stackoverflow.com/questions/5...-using-arduino Only thing I would change is use Serial.readBytesUntil() rather than reinventing that particular wheel with a while loop.

      Note that unlike most other programming languages, in C and C++ a string is not a fundamental data type. They therefore do not support direct string comparisons. This, for example, won't work:

      [code]
      if (var == "foobar") {
      /* do something*/
      }
      [/code]

      Instead you have to rely on a function, like:

      [code]
      if (strcmp(var, "foobar")) {
      /* do something */
      }
      [/code]

      This might be close to what you're trying to do as well: http://arduino.cc/en/Tutorial/ReadASCIIString
      Charles
      --
      1979 Suzuki GS850G

      Read BassCliff's GSR Greeting and Mega-Welcome!

      Comment


        Ok I'm going to have to look at an Arduino at some point, just for the fun factor! I write heaps of scripts at work but in PowerShell, Perl, and VBScript/ASP and I'm... well... probably better than average but not brilliant.

        Being able to put that into something like the Arduino to do cool stuff is... well... very cool!

        Best wait 'til after my shed and the little Duc are finished and I have acquired my Kat...

        Oh, and where are the obligatory "finished" pic's? Slack!
        1982 GS450E - The Wee Beastie
        1984 GSX750S Katana 7/11 - Kit Kat - BOTM May 2020

        sigpic

        450 Refresh thread: https://www.thegsresources.com/_foru...-GS450-Refresh

        Katana 7/11 thread: http://www.thegsresources.com/_forum...84-Katana-7-11

        Comment


          Originally posted by pete View Post
          Ok I'm going to have to look at an Arduino at some point, just for the fun factor!
          they're a good time, and cheap enough that it's not a budget buster to just fiddle around with them. I'm trying to figure out how i can interface mine with a narrow band O2 sensor to get a budget A/F ratio guage.

          Originally posted by Mekanix
          Cool, I'm actually learning this stuff
          That Gauge cluster project is pretty sweet. You'll pick the code up slowly but surely. The rest is learning how to make it efficient, which is usually the harder part. Keep up the good work.

          Comment


            lol coming along pete.

            Its just the bare bike with no plastics or tank.





            No way could I torque the rotor on, I tried with the break but it didn't matter no matter what gear I was in. The clutch couldn't take more than 40'lbs before it would slip. <might need some new springs for the clutch I think! >

            SO I hit it with the impact gun and a 90'lbs torque bar. That seemed to work just fine. Also used red locktite. Although that's the first time I've ever used it




            I'm also toying with a heated seat.

            Thinking of setting up the arduino with a relay and temperature sensor to feedback to my phone, That way i t can turn the seat on and off and have it regulate depending on the temperature.


            Everything you need to know is in the examples that come with the sketch program. You can see how its written and then just mess with it to get it to do what you want. That's how I started learning last month.

            main site
            Open-source electronic prototyping platform enabling users to create interactive electronic objects.


            download
            Open-source electronic prototyping platform enabling users to create interactive electronic objects.




            This is what I have thought of so far.
            • Gear position. Code does work but its pretty bulky. This can be put in just the way it is and It will work.
            • Rev limiter/ shift light.
            • Heated seat.
            • Dataloging. Realtime clock maybe for time stamps.
            • Serial output of all sensors ( gear position, rpm, seat temp, CHT) My code for this works and its pretty simple but I need to learn how to send meaningful information and scale it properly.

            Thanks eil, I'm reading this tutorial.http://www.iu.hio.no/~mark/CTutorial/CTutorial.html


            Only thing I need is the time :P





            Last edited by Mekanix; 05-17-2013, 10:24 PM.
            Stephen.
            1981 GSX540L "Frankintwin"
            1989 GS500E Resto-mod .

            400 mod thread
            Photo's 1

            Photos 2

            Gs500 build thread
            GS twin wiki

            Comment


              Noooooooooo! Naked bike pics. LOL She's looking good.I had no issues with the stock clutch holding 90ftlbs of torque.Has standard auto oil been used in the engine?That will cause the clutch to slip really bad.Synthetic oil will make it worse,if it's not designed for wet clutches.I use 15w40 Rotella T diesel oil.I have been surprised at how much it improved transmission shifting and clutch engagement.I am running a bastardized clutch.SV650 kevlar friction disc and Barnett racing springs.My left arm and hand is getting big from that stiff clutch.BTW,I just bought another bike,Yamaha V Star 650,I am going to try out some fully synthetic motorcycle wet clutch spec 20w50 that comes highly recommended for air cooled twins.i can't remember the brand right off.I'll have to check.I bought a bunch of tune up stuff for the new to me bike.I am keeping my six GS500's.Still building the big engine.Also got my touring GS project.

              Comment


                Mate good stuff, the Arduino looks very cool! Data logging would be very handy especially!

                As for the clutch slipping... holding the back brake on to torque the sprocket nut up shouldn't even use the clutch...

                Red locktite? Mate you're keen! Gonna need a heat gun to get that off next chain/sprocket change

                But lookin' good all the same
                1982 GS450E - The Wee Beastie
                1984 GSX750S Katana 7/11 - Kit Kat - BOTM May 2020

                sigpic

                450 Refresh thread: https://www.thegsresources.com/_foru...-GS450-Refresh

                Katana 7/11 thread: http://www.thegsresources.com/_forum...84-Katana-7-11

                Comment


                  Originally posted by pete View Post
                  Mate good stuff, the Arduino looks very cool! Data logging would be very handy especially!

                  As for the clutch slipping... holding the back brake on to torque the sprocket nut up shouldn't even use the clutch...

                  Red locktite? Mate you're keen! Gonna need a heat gun to get that off next chain/sprocket change

                  But lookin' good all the same

                  I meant the rotor for the stator :P

                  This thing has a circlip that holds on the front sprocket. Its one of the few differences from the 450.

                  The clutch is the stock one with 88000 on it. I know the plates and disks are in spec but who knows what's been run in this engine. I have a spare set to play with just in case. I started with 50' lbs in sixth gear and by the time I took up all the slack in the drive train it started slipping. So I dropped it to 40 and thats where it clicked. The clutch is dry though and hasn't been wet or worn in again yet. Looking forward to seeing if its going to slip or not.

                  I suppose I could shim the springs but I'll probably replace them. My other bike could barely handle the power in second gear and could slip occasionally.

                  Also checked the compression dry with the rings not fully seated and got 140, 145.

                  Bet that will go up with oil and wear in.
                  Stephen.
                  1981 GSX540L "Frankintwin"
                  1989 GS500E Resto-mod .

                  400 mod thread
                  Photo's 1

                  Photos 2

                  Gs500 build thread
                  GS twin wiki

                  Comment


                    Aaaah ok! In that case red loctite is a good thing!

                    Compression figures sound quite good too...
                    1982 GS450E - The Wee Beastie
                    1984 GSX750S Katana 7/11 - Kit Kat - BOTM May 2020

                    sigpic

                    450 Refresh thread: https://www.thegsresources.com/_foru...-GS450-Refresh

                    Katana 7/11 thread: http://www.thegsresources.com/_forum...84-Katana-7-11

                    Comment


                      Not too much to add.

                      Seat is done, just have to pick it up.

                      Paint is coming along nicely

                      Working on a good waterproof case for the arduino.

                      In the mean time I've been busy with a new project while waiting.


                      Picked up another GS :-D


                      I bought a 1996 Seadoo GSX 800.

                      Working on rebuilding the motor, Needed one cylinder redone so I'm doing both at the same time and collecting parts as I go.

                      Should be ready within the next few weeks.

                      Also Getting the head back for the 540 this week or next. So that project can resume.
                      Last edited by Mekanix; 06-02-2013, 10:39 PM.
                      Stephen.
                      1981 GSX540L "Frankintwin"
                      1989 GS500E Resto-mod .

                      400 mod thread
                      Photo's 1

                      Photos 2

                      Gs500 build thread
                      GS twin wiki

                      Comment


                        Cool... what's the waterproof case for the Arduino like?

                        Keen to see that 540 done too!
                        1982 GS450E - The Wee Beastie
                        1984 GSX750S Katana 7/11 - Kit Kat - BOTM May 2020

                        sigpic

                        450 Refresh thread: https://www.thegsresources.com/_foru...-GS450-Refresh

                        Katana 7/11 thread: http://www.thegsresources.com/_forum...84-Katana-7-11

                        Comment


                          Ziplock container Pete :-D Seemed to be the easiest thing to work with. I'm just going to stick it on with double sided tape.



                          I got all the paint back from Daryl (Fjbj40)


                          Felt like this when I saw it.



                          So ill be running it this week I'm sure.



                          Last edited by Mekanix; 06-03-2013, 01:18 AM.
                          Stephen.
                          1981 GSX540L "Frankintwin"
                          1989 GS500E Resto-mod .

                          400 mod thread
                          Photo's 1

                          Photos 2

                          Gs500 build thread
                          GS twin wiki

                          Comment


                            That's my fav color.Sweet.

                            Comment




                              Was busy with another bike recently

                              Can you spot the volt meter ?





                              Find many great new & used options and get the best deals for Lithium Battery Digital Voltmeter DC 3.3v - 17V Blue LED Small Panel Meter SS at the best online prices at eBay! Free shipping for many products!
                              Last edited by Mekanix; 06-03-2013, 02:19 AM.
                              Stephen.
                              1981 GSX540L "Frankintwin"
                              1989 GS500E Resto-mod .

                              400 mod thread
                              Photo's 1

                              Photos 2

                              Gs500 build thread
                              GS twin wiki

                              Comment


                                Ziplock container... love it!

                                Love that blue too! I almost went blue on the 450 but there are so many different shades/hues of blue it's critical to get the right one... I reckon yours is spot on!

                                The volt meter's pretty cool too... and cheap! Got the 540 head back yet?
                                1982 GS450E - The Wee Beastie
                                1984 GSX750S Katana 7/11 - Kit Kat - BOTM May 2020

                                sigpic

                                450 Refresh thread: https://www.thegsresources.com/_foru...-GS450-Refresh

                                Katana 7/11 thread: http://www.thegsresources.com/_forum...84-Katana-7-11

                                Comment

                                Working...
                                X