Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

L293 H-bridge Control


Best Answer hanzibal, 08 June 2013 - 10:30 AM

Ok, just modify the erroneous line like this:

// Defines the HBridge IC on the correct pinsHBridgeMotorDriver = new HBridge(PWMChannels.PWM_PIN_20, Pins.GPIO_PIN_19, PWMChannels.PWM_PIN_18, Pins.GPIO_PIN_17);

It works for me (Netduino mini with framework 4.2) and should for you too I hope.

 

EDIT: Works = the code compiles but I don't have a H-brigde driver and forgot to check with the scope.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 SlartiBarfarst

SlartiBarfarst

    New Member

  • Members
  • Pip
  • 4 posts

Posted 04 June 2013 - 08:57 PM

I'm new to the Netduino community, and just got my LED to flash, now I'm ready for something more complex.

 

  In the past I've driven a motorized tank using a L293 H bridge and a Basic Stamp, and would like to do the same with my Netduino Mini.

 

  I have found a driver at http://netmftoolbox....pported devices however I am receiving the error pictured in the attachment below.

 

any assistance/ suggestions would be greatly appreciated.

Attached Files



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 05 June 2013 - 09:08 PM

Hi! One or more of the HBridge constructor parameters are of the wrong type. Try writing Cpu.Pin.xxx instead of just Pins.xxx. Does that help? If not, a silly way to find out what is the cause, replace both PWM object parameters with null. if the error goes away, then you know the PWM obejcts are of the wrong type. If not, it's the Pins. Depending on the outcome of the above, investigate further as needed by examining the type of the corresponding parameters making sure they match those of the method signature.

#3 SlartiBarfarst

SlartiBarfarst

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 June 2013 - 02:03 AM

Thank you for your reply, I tried using Cpu.Pin.## instead of Pins.## with no success.

 

I'm new to object oriented progamming so I'm not fluent with the launguage, but I think I understand.

 

Could the issue be caused by HBridge calling on the Microsoft.SPOT.Hardware.Cpu.Pin whose pin enumeration differs from that of the Mini?



#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 07 June 2013 - 09:57 AM

Did you try replacing with null as described? The error has nothing to do with oop, it's just a matter of passing parameters of the correct type. Yes, it could be enumerator difference between the two. EDIT: Could you zip and attach your code so I could try it?

#5 SlartiBarfarst

SlartiBarfarst

    New Member

  • Members
  • Pip
  • 4 posts

Posted 07 June 2013 - 11:58 PM

Sorry I neglected to mention that nulling both the PWM params results in the same error.

 

Here is a zip of the project as requested, not exactly the same as in the previous pic.

 

This permutation only results in a namespace error that I can't seem to resolve.

 

Thanks again for your assistance.

Attached Files

  • Attached File  L293.zip   12.91KB   10 downloads


#6 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 08 June 2013 - 10:30 AM   Best Answer

Ok, just modify the erroneous line like this:

// Defines the HBridge IC on the correct pinsHBridgeMotorDriver = new HBridge(PWMChannels.PWM_PIN_20, Pins.GPIO_PIN_19, PWMChannels.PWM_PIN_18, Pins.GPIO_PIN_17);

It works for me (Netduino mini with framework 4.2) and should for you too I hope.

 

EDIT: Works = the code compiles but I don't have a H-brigde driver and forgot to check with the scope.



#7 SlartiBarfarst

SlartiBarfarst

    New Member

  • Members
  • Pip
  • 4 posts

Posted 09 June 2013 - 02:10 AM

You are my hero, it works great.



#8 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 09 June 2013 - 12:47 PM

That is great news, good luck with your project!






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.