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

Netduino + LinkSprite JPEG Camera


  • Please log in to reply
8 replies to this topic

#1 Rik P.

Rik P.

    Member

  • Members
  • PipPip
  • 18 posts

Posted 15 March 2011 - 12:44 PM

Hi all I've just purchased a Linksprite JPEG camera (http://proto-pic.co....-Interface.html) and intend on using it with the Netduino. All the sample code available is targeted for the Arduino platform, and that makes heavy use of the Newsoftserial library, which of course I (think!) don't need on the Netduino platform. My problem here relates to the porting of the library over from arduino to netduino, and the apparent differences between the serial port implementation on both these platforms. Specifically, C# seems to return data from the serial port as an event, while the Newsoftserial library will instead read data from the port within the context of the calling method. This presents a challenge to me and I was wondering if we could start a discussion on the caveats/pitfalls of arduino/netduino library conversion with a specific focus on the differences in the serial implementations and the event-driven model used in the C# implementation? Just looking to moot some ideas and get some general pointers. If I manage to port the code across to something that works I will of course share it with the community! Thanks, Rik.

---
Twitter: @rikp


#2 Gus Issa

Gus Issa

    Member

  • Members
  • PipPip
  • 14 posts

Posted 15 March 2011 - 11:30 PM

It is already done http://www.fezzer.co...camera-library/
  • Rik P. likes this

#3 Rik P.

Rik P.

    Member

  • Members
  • PipPip
  • 18 posts

Posted 16 March 2011 - 09:48 AM

It is already done http://www.fezzer.co...camera-library/


Well that certainly saves a *heap* of time - thanks for the tip ;)

---
Twitter: @rikp


#4 nsm

nsm

    New Member

  • Members
  • Pip
  • 1 posts

Posted 13 October 2011 - 06:40 PM

It is already done http://www.fezzer.co...camera-library/

This link no longer resolves. Does anyone have an update or a copy of the library?

#5 Philip

Philip

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationPreston, England

Posted 28 October 2011 - 11:55 AM

This link no longer resolves. Does anyone have an update or a copy of the library?


I'd second that - the link no longer works. HELP!

#6 Stefan W.

Stefan W.

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts

Posted 28 October 2011 - 11:59 AM

Don't know if it's the same, but http://code.tinyclr....camera-library/ looks similar.
I believe that no discovery of fact, however trivial, can be wholly useless to the race, and that no trumpeting of falsehood, however virtuous in intent, can be anything but vicious.
-- H.L. Mencken, "What I Believe"

#7 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 28 October 2011 - 12:00 PM

This link no longer resolves. Does anyone have an update or a copy of the library?

FEZ code repository is hosted on code.tinyclr.com, there is Linksprite Camera Library entry there (not sure it's the same).

Edit: Stefan W. beats me to it ;- )

#8 AndrewC

AndrewC

    New Member

  • Members
  • Pip
  • 9 posts

Posted 13 November 2011 - 05:15 PM

Does anyone have this working? I used the code in the links above but I'm having 2 strange issues. 1. The code runs fine if I step-through it, but doesn't work if I just run it. Should I be introducing some sleep() time after writing to the camera? 2. When stepping through the code, the Port.Read() command throws a System.Exception when there are not more bytes read instread of returning 0 bytes read. Any thoughts on why this is happening? Thanks Andrew

#9 AndyC

AndyC

    New Member

  • Members
  • Pip
  • 3 posts

Posted 16 November 2011 - 01:34 PM

font="Arial"][/font]

Does anyone have this working? I used the code in the links above but I'm having 2 strange issues.
1. The code runs fine if I step-through it, but doesn't work if I just run it. Should I be introducing some sleep() time after writing to the camera?
to naswer my own questions -> yes you need to pause about 100ms after sending a command to the camera

2. When stepping through the code, the Port.Read() command throws a System.Exception when there are not more bytes read instread of returning 0 bytes read. Any thoughts on why this is happening?
If you try to read more bytes then the buffer has, you will always time-out (remember you did set the port time to something reasonable like 250ms) and thus will almost always have a system.exception which will need to be thrown away

private in Read(byte[] buffer, int bytes)
{
int i = 0;
try {
i = port.Read(buffer, 0, bytes)
}
catch (Exception e)
{
}
return i;
}
[
Thanks
Andrew






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.