it doesent warn you cos float is a lot of numbers, in fact 10(.0) is a float too.
in anohter thread chris mentioned to call pwm.Start(); -- so i think thats the problem here

![]() |
  | |||||||||||||
![]() |
|
![]() |
||||||||||||
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.
NooM's ContentThere have been 301 items by NooM (Search limited from 17-June 23) #46221 VS2012 NetduinoPlus 4.2 firmware
it doesent warn you cos float is a lot of numbers, in fact 10(.0) is a float too.
in anohter thread chris mentioned to call pwm.Start(); -- so i think thats the problem here #46226 Is there a Watchdog breakout out there?
sry i dont have the code anymore, but its very very simple. i used the arduino ide and language to programm the tiny.
its like that: setup one pin as input, one as output, pullup enabled. (let it run with 3.3v, 1mhz internal oscillator)
make a timer with milis() .. .. everytime the inputpin changes, make the timer a new value, the ammount is on yours (i used 1000msec) when it runs out, pull output (connected to reset) down, let it down for like 50msec, make it high again, start over (i suggest adding a 1 minute, maybe more, startup time, depending on your code, so it wount reset before the netduino is executing your code.
netduino side: just set a pin connected to the tiny high and low a value you like #46324 GPIO as analog input
short: doesent work.
solutions: multiplex your analog inputs (bad) or use external adc ic's over spi/i2c (spi prefeered, can use more)
in the link in my signature is code for the MCP3201 ... its only one port, but easy to change for the 4 or 8 port versions #46359 Firmware v 4.3
you can either flash the duino with netmf 4.3 firmware or set the output in vs2012 to 4.2 (on project -> settings)
edit: you find usefull information in the forums pinned on top. 4.3 firmware is here: http://forums.netdui...re-and-drivers/ #46360 Touch, 320x240 LCD Driver for Netduino+ 2
id get an stm32fx with lcd from ebay (iam sure you can contact the manufacture) - than you can "relativly easy" wite you own drivers there - and its so cheap, it would be cheaper than yours actually (they are like 20-40€)
that also gives the option to add your own commands and whatever you want #46370 Pushing the project out of the board
if you can get the boards and solder qfp64 (thats the smallest stm32f4, they are up to 176pins) its relativly easy. just the crystal has to be the same than netduino so it can run netduino firmware. when you do it yourself you can also use way more pins of the cip.
ive never done one myself.
the schematics are open source also, so you can look there what is used and connected to wich pin. #46406 Touch, 320x240 LCD Driver for Netduino+ 2
yeah use a seperate chip as "graphic card" (native, not netmf) the toolchain, yeah. i got coocox setup, and the serial communication ready, but thats all ni could do (without much reading) - but a professional should be able todo way more. arm offers a library collection called cmsis wich helps accessing all the stuff like serial, spi..
but let me explain my post: their display/board (that vizic) looks very much like the ebay ones, and its NOT very lowcost. i also think it works the way i descibed it, someone wrote a driver for it wich you control per uart - like you send a simple command: draw reachtange at position x,y with size w,h (thats around 9 bytes) #46416 Documentation for .NET MF
its sad if you _cant_ find one.
but ok, for the lazy guys: SerialPort serialPort; serialPort = new SerialPort("yourcomport", 115200);serialPort.DataReceived += DataReceivedHandler;serialPort.Open();------ok this is non standard, but i send the "packet" lenght all the timevoid DataReceivedHandler(object sender, SerialDataReceivedEventArgs e) { Int32 identifier = serialPort.ReadByte(); if (identifier == 0) { Int32 length = serialPort.ReadByte(); Byte[] packet = new Byte[length]; serialPort.Read(packet, 0, packet.Length); Byte[] decodedData = COBS.Decode(packet); if (DataReceived != null) DataReceived(decodedData); } }public void Send(Byte[] Data) { Byte[] encodedData = COBS.Encode(Data); Byte[] packet = new Byte[encodedData.Length + 2]; packet[0] = 0; packet[1] = (Byte)(encodedData.Length); encodedData.CopyTo(packet, 2); serialPort.Write(packet, 0, packet.Length); }
if your are interested, the encode/decode functions are linked in my signature, i find them pretty usefull, since its possible to loose data, it resyncs automatically. #46688 How do I get this servo running?
PWM pwm = new PWM(PWMChannels.yourpin, 100, .5, false); pwm.Start(); #46696 Main 'entry point' / threading issue
public static void Inputs() { ... }
will do the trick. id also suggest putting a: Thread.Sleep(Timeout.Infinite); after you thread initialization code in the Main() #46722 Main 'entry point' / threading issue
sorry i just havent really looked at his whole code, but the issues sounded like missing statics. yeah the beast way is make your main class not static.
ziggurat made a very good sample, but i have some suggestions: namespace NetduinoApplication1{ public class Program { //XXX ... various instance vars // place this at the end of your file here, normally you not gonna change //anything in main anymore. public static void Main() { //XXX make an instance of the Program, and forward execution Program pgm = new Program(); while(true) { pgm.Update(); } } public Program() { Thread t1 = new Thread(Inputs); t1.Start(); Thread t3 = new Thread(Pressure); t3.Start(); } public void Update() // loops. { // thread.sleep ... } void Inputs() { //XXX ... interesting stuff in a thread that can access the member vars } void Pressure() { //XXX ... interesting stuff in a thread that can access the member vars } }} #46793 How to use the serial port on Netduino 2?
well, nice for mentioning all the help you got from
http://blog.codeblac...with-RS232.aspx
- and actually, it wasent easy, it was a pain (it was easy for me
none the less, its a cool project, i like wireless stuff #46818 Trouble powering Mini using battery
http://wiki.netduino...mini_pinout.pdf
pin 21 is _only_ for 5v regulated. id not connect 4x1.6v batteries to it
the 9v bat should work fine on pin24 and gndpin
my mini runs with one 3.3volt battery (lifepo4) - i stepped it up to 5v and used pin21. #46843 Netduino Plus 2 + second SD Card
well, its doable.
you have to write your own drivers for it. #46922 Is it possible to connect multiple mainboards together in a star network topo...
yes this is possible.
you can do this over ethernet or use wireless nodes (but they have to be in a tree like arrangement to work well) with nrf24l01+
if you just need output ports, you can use 74hc595 - they are very good for that, you can chain them up to quite a lot of outputs. its also way way cheaper than multiple netduinos. #46944 SPI and I2CDevice not working together
i used both together and it worked fine. (different devices, but spi and i2c, each with multiple devices)
add some code so we can have a look, wild guessing is no fun #46993 String to byte array for serial output
Thread.Sleep(-1); will sleep forever, so your write never gets called. just remove it.
port.Write(teststring, 1, testing.Length); - why start with 1 here? you start with 0.
public static void Main() { initComs(); //opens com port and awaits data Thread.Sleep(500);//added this in case the com port wasn't ready fast enough //importData(); //imports data from SD card--for later string teststring= "Powerisoff"; byte[] data = System.Text.Encoding.UTF8.GetBytes(teststring); port.Write(data, 0, data.Length); Thread.Sleep(-1); } static void initComs() { port = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One); port.DataReceived += new SerialDataReceivedEventHandler(RecievedData); port.Open(); }
#47043 BMP085
i can read it out, yes, thats simple.
i wondered if there is a formula to make it more precise with the temerature calculating into it.
but well, i dont really use it anymore, so no need for investing any further, thx anyways #47055 BMP085
sure, the bmp is a pressure sensor, and iam very sure temperature affects air pressure #47075 System.Exception during Debug.Print
i guess its: Debug.Print(new string(System.Text.Encoding.UTF8.GetChars(buffer)));
when you get the chars, it expects that the byte data is correct, now with serial the chances are big that it isent (my experience so far)
if you send the data from a computer, print out there the byte data, and also on the netduino ( Debug.Print(buffer[0]); .. in a loop till buffer lenght) and compare them. it happened a lot for the data gets shifted and never syncronizes again
iam using cobs as packetframe, since that it never happened again #47086 BMP085
ok, thanks for the explanation.
yeah i was looking for a formula that calculated this, cos i thought (and still think) it has a reason the bmp has a temerature sensor also #47087 System.Exception during Debug.Print
btw, in my signature is a link to my playground, and there is the COBS code. i really like it, cos it automatically resyncs. or aqt least makes it possible. i removed the serial implementation for now since i had a bug with it on my board, so iam not sure about netduino. but its very simple. you encode your data, make a new byte array with 2 bytes bigger of the encoded data, add a 0 at pos 0 and the lenght of the encoded data on pos1, than in receive funktion look for the 0, when you receive one, the packet starts, than read the lenght, you know that how big the packet is and read the ammount of bytes, than decode it, violla #47162 I2C on Netduino 1 not working
id look at an existring driver for that display (netduino) so you can see the settings and such.
id also use an multi i2c class. (link in my signature) #47163 Serial Monitor on Netduino mini (with LCD+UI & using both ports)
very good! and i like the display a lot #47185 SPI and I2CDevice not working together
in my signature is a link to my playground, you can find a multi i2c and multi spi class there. and a simple rtc (ds1307) class that shows the usage of the multi i2c (spi is very simmiliar to use!)
| ||||||||||||||
![]() |
||||||||||||||
![]() |
|
![]() |
||||||||||||
![]() |
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ![]() |
||||||||||||
![]() |