Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Arduino for OM - In progress

  1. #1
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    569

    Arduino for OM - In progress

    This is my first plug-in. I am not yet comfortable with releasing it, pending a couple others testing it out, but it should be ready in a week or two.

    The plug-in allows basic operation with an Arduino. My test bed is an Arduino Uno with v0022 with firmata 2.2. I should be able to test it against an Arduino Mini at some point.

    Rather than worry about Arduino users coming up with their own "sketch" to put on the Arduino, and then try to communicate with it, I chose Firmata. The protocol is loosely based on MIDI and allows the PC to tell the Arduino what to do, and receive status from the Arduino.

    First: I am novice at using Visual Studio and OM plug-ins, and have learned quite a bit about it over the last 1-2 weeks (when I had free time), and this plug-in may reflect that, but I have had input from OM devs and I feel this plug-in is not that bad

    Second: What the plug-in can do:
    • allows the user to specify a digital pin as Input or Output, in Settings
    • allows the user to specify a label for analog inputs (such as TempIN), in Settings
    • allows the user to specify com port, baud rate, and Arduino type, in Settings
    • allows the user to toggle the state of any pin designated as Output, in the main screen
    • shows the label and status of the pins, in the main screen
    • provides OM Sensors for the digital and analog pins for other plug-ins & skins
    • future: allow user to specify a label for digital pins - Done
    • future: allow user to specify min and max range values for analog bar - Done
    • future: use globalization for display of values that have regional differences - Done
    • possible future: support multiple boards
    • to do: basic documentation
    • to do: new allow user to specify an pin action based on another pin value (Conditions)


    A reasonably skilled Arduino programmer could also add custom code to the main loop of the Firmata sketch, download it (outside OM) and perform some autonomous tasks, but the trade-off would be that the plug-in would not know the state of any outputs (Arduino/Firmata does not report back the state of OUTPUTS). I have added code that basically remembers the last write to a digital pin that is designated OUTPUT, and report that back when a read is done.

    I have a few little nagging items to take care of (such as ensuring good behaviour on sleep/resume), but the current code does work for me. I have made it to handle most versions of Arduino except Mega. Although a future version may include it.

    I have not implemented PWM. I have not come up with an idea I am happy with on how to do PWM with a user interface in OM. There are as many implementations for PWM as there are users so a common interface may be difficult.

    If you have ideas and dream list items, feel free to post here so I have food-for-thought. That is, other than fancy skin items as I am not a graphics designer

    Oh, PS: Only built against the upcoming 0.9 versions.

    Cheers,
    John


    NOTE: the Conditions button is just a placeholder for now
    Attached Images Attached Images  
    Last edited by jmullan99; 02-13-2011 at 12:13 PM.
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

  2. #2
    Variable Bitrate Borte's Avatar
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    445
    Nice work!
    Failure is not an option...
    __________________________________________________ ______________________________
    The only full multizone / multiscreen cross platform open source Front End -> OpenMobile

  3. #3
    Raw Wave
    Join Date
    Nov 2009
    Posts
    2,118
    x2.
    I have 2 Duemilanoves but have yet to work on them.

    Obtained originally as a PIC-inlieu; intended otherwise for assembler; may well use for ignition timing, sequential spark determination - maybe EFI.

    jmullan99 may cause me to start work!

    Thanks!


    PS - Chester (below) - I forgot electric water pump controller. Why spend >AUD$300 on the commercial item?
    PPS - it's the impetus or push jmullan may give me; I've long had the ideas.
    Oh - you meant my idea to actually START something real? Now that is a novel thought! Hmmmm.....

  4. #4
    Variable Bitrate
    Join Date
    Jun 2008
    Location
    Perth, Western Australia
    Posts
    337
    Uh-oh, look what you have done now jmullan, you have given OldSpark ideas, I'm glad I live on the other side of the country from him LOL :P

    Great work on the plugin, its looking very tidy! It's always good to see people jump in and get their hands dirty

  5. #5
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    569
    Quote Originally Posted by Chester View Post
    Uh-oh, look what you have done now jmullan, you have given OldSpark ideas, I'm glad I live on the other side of the country from him LOL :P

    Great work on the plugin, its looking very tidy! It's always good to see people jump in and get their hands dirty
    Ha ha. Always feels good to inspire others

    The screen is slightly improved, but I have left space under the analog bars because some Arduino boards have 8 while others have 6. Plus I should need the remainder of the space for other information.

    Multi-board will take a while, depending on how fast I build my skills on this. Either a major re-write, or multiple plugins similar to the embedded app plugins.

    First release once ready, will just be basic. However, I tested with a trial of Heezer7's upcoming Character LCD plug-in and the Arduino pin information is available for display. Thats a bonus.

    I persued Arduino because I wanted to have an exterior and interior temperature reading (my 2003 Altima doesn't have this feature ).

    I have come up with my own dream wish: A basic "If input x then output y". While I have a really undeveloped idea for this, it may not make it to first version. But my current thought it is doable.


    It seems OM is starting to reach adulthood!

    John
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

  6. #6
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    569
    Quote Originally Posted by OldSpark View Post
    x2.
    I have 2 Duemilanoves but have yet to work on them.

    Obtained originally as a PIC-inlieu; intended otherwise for assembler; may well use for ignition timing, sequential spark determination - maybe EFI.

    jmullan99 may cause me to start work!

    Thanks!


    PS - Chester (below) - I forgot electric water pump controller. Why spend >AUD$300 on the commercial item?
    PPS - it's the impetus or push jmullan may give me; I've long had the ideas.
    Oh - you meant my idea to actually START something real? Now that is a novel thought! Hmmmm.....
    I started working with a PIC to implement my temperature readings. Then the task of first implenting my own protocol between it and a plug-in for OM seemed too daunting. Then I stumbled on the Arduino with Firmata and 1/2 the chore was already done. I had to modify a GPL'd library to help me talk Firmata, and I was off-to-the-races.

    At this point, I'm not confident this plug-in will help you with water pump controller or EFI. But you could modify the Firmata sketch for your Arduinos. You will still get the pin information in the plug-in, and be able to toggle the digital outputs.

    John
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

  7. #7
    Maximum Bitrate
    Auto Apps:loading...
    VegasGuy's Avatar
    Join Date
    May 2009
    Location
    Las Vegas
    Posts
    612
    Check out NetDuino and NetDuino Plus too. Same concept (Arduino + different shields = different functionality), but it utilizes the .net microframework...so you write your "sketch" in standard C#, and have access to a nice subset of the standard .net framework.

    Picked one up last week, and am now (slowly) investigating how I'll use it in my truck. Very well made, fires right up and maybe 30 minutes to have a simple CF plugin with a button that turned the onboard led on and off. Not particularly useful, but all the basics needed for interaction were there.

    I'm happy!

    VegasGuy

  8. #8
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    569
    Quote Originally Posted by VegasGuy View Post
    Check out NetDuino and NetDuino Plus too. Same concept (Arduino + different shields = different functionality), but it utilizes the .net microframework...so you write your "sketch" in standard C#, and have access to a nice subset of the standard .net framework.

    Picked one up last week, and am now (slowly) investigating how I'll use it in my truck. Very well made, fires right up and maybe 30 minutes to have a simple CF plugin with a button that turned the onboard led on and off. Not particularly useful, but all the basics needed for interaction were there.

    I'm happy!

    VegasGuy
    My plugin should work with any Arduino variant/clone, as long as Firmata has been left on it (installed on it). Most have 14 digital I/O pins and 6 or 8 analog pins. I purposely left off digital pins 0 and 1 since they are used for serial comms. The plug-in adjusts the number available according to the model you select in settings. I did not put in any clones in the board list, but just select the model that is being cloned. For interface purposes, there really only seem to be 3 basic types.

    I have an Arduino mini on the way, and will test with that. But it's basically the same.

    I am nurturing a thought on some basic custom stuff, but there is a limit to what can be done on a front-end, on a 7" screen, and be usable for anyone. Imagine the combinations of input/output, action/reaction. As previously mentioned, the user can add custom code to the Arduino Firmata or, once available, customize this plug-in's code for their own special purposes.

    On a separate note, I believe I have the sleep thing working (thanks Heezer7).

    John
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

  9. #9
    Maximum Bitrate
    Auto Apps:loading...
    VegasGuy's Avatar
    Join Date
    May 2009
    Location
    Las Vegas
    Posts
    612
    Quote Originally Posted by jmullan99 View Post
    My plugin should work with any Arduino variant/clone, as long as Firmata has been left on it...John
    If firmata is what you normally write the sketches in and then run on the duino, it is replaced by the .net microframework. If it is something that sits below that level, then I don't know.

    VegasGuy

  10. #10
    Maximum Bitrate jmullan99's Avatar
    Join Date
    Feb 2009
    Location
    Niagara Falls, Ontario
    Posts
    569
    Quote Originally Posted by VegasGuy View Post
    If firmata is what you normally write the sketches in and then run on the duino, it is replaced by the .net microframework. If it is something that sits below that level, then I don't know.

    VegasGuy
    Well actually, Firmata is a protocol that has been created to be implemented on many micro-controllers. The Arduino crowd has implemented it and it comes pre-installed now on Arduino along with the bootloader. You don't write code in Firmata.

    I believe your discussion is on creating software to run on Arduino, Netduino and other compatibles and I don't think that is applicable to my plug-in. The problem is that every implementation for each individual is different. I have thought about how to make Arduino most useful to most folks running OpenMobile. To make a common interface, a protocol makes sense (to me anyway). Firmata is established and eliminated the need to design and test my own. Which could have been weeks in the making.

    My plug-in is really just the first step toward connecting an Arduino to OpenMobile. The screen I am working on merely puts a face on it. This approach allows each user to put the custom code they require on the Arduino to handle their needs. It is a small extra step to include Firmata with it (basically hooking into the the main loop{} in the Firmata sketch.

    It's possible to make a skin to provide a custom interface to Arduino, then get and set Arduino "sensors" created in the plug-in from that skin to control Arduino.

    A few folks could even get together and come up with a "standard" of sorts, of what the Arduino will do, and build an interface/skin for that standard. More likely a set of standards, as some folks want HVAC control (practically a whole Arduino dedicated to that task), some want to control vehicle security like windows and door locks. And yet others want engine systems feedback (but there will eventually be a separate OBDII interface not requiring Arduino).

    Anyway, I would be interested in the .NET stuff for Arduino for creating sketches and will check that out at some point. Thanks for that.

    Cheers,
    John
    Last edited by jmullan99; 02-06-2011 at 06:33 AM. Reason: spelling, et al.
    ZOTAC G43ITX-A-E 2.5ghz Core i3 2GB 160GB SSD
    Win7 Ultimate - OpenMobile - Directed HD - Wifi
    OMMaps + MS GPS Puck - WiFi via LTE Android phone
    2 Zones - Matrix Orbital LCD - Arduino - Build Pics

Page 1 of 3 123 LastLast

Similar Threads

  1. arduino to control car hvac..blog/code/reference?
    By Wayne613 in forum Open Source Hardware
    Replies: 12
    Last Post: 04-02-2011, 02:49 PM
  2. Using Arduino to Auto-dim LED EBY701?
    By stevey500 in forum LCD/Display
    Replies: 29
    Last Post: 08-21-2010, 12:04 AM
  3. Suggestion: Arduino Based RGB Ambient light software
    By stevey500 in forum Software & Software Development
    Replies: 4
    Last Post: 08-04-2010, 01:54 PM
  4. Arduino BT CarPC power controller
    By d_mc_a in forum Hardware Development
    Replies: 4
    Last Post: 03-18-2009, 09:20 PM
  5. Rc2 Without Progress Bar???
    By coucouillu in forum Centrafuse
    Replies: 35
    Last Post: 08-11-2006, 02:49 PM

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
  •