Information overflow. However, I see I have FEZ spider 1.0 and I surmise that 4.2 (and VB) are OK?
Yes spider works with VisualBasic.
To IanLee
I am first trying the code in C# that you gave earlier in this thread, and I get two errors. First ‘…does not contain a definition for ProgramStarted…(are you missing using a directive or an assembly reference)’. Second 'the name PulseDebugLED does not exist in the current context.
Hi Alan,
can you talk us through how you created the project then? By definition, using the Gadgeteer template will ALWAYS create a programstarted method.
Make sure you drag in the right mainboard too, then go to the program.cs and put in the code
Hi Brett
Many thanks for prompt reply! In fact I now find that the laptop I am trying this on does not even see the device (the USB client)! (I also use a desktop, which does). So I’d better fix that first and come back to you.
To answer your question, I started a new c# project, wired up the modules on the screen and then matched that physically,. Then I went to the program screen and pasted Ian’s C# code in, and tried f5.
BTW, In view of Ian’s strong views I thought I would try the c# first before (possibly) going on the the vb.
I am happy to hear you’re giving C# a whirl.
So when you open up the program.cs file, you should already see a shell of an application. All you really should need to cut/paste is the 3 important lines starting with VAR TIMER= and running through to TIMER.START(). Everything else should already be a part of that. By pasting things over the top, you’ve replaced the ProgramStarted() function, and because hierarchically it has to be a member of the same namespace (which is basically how you named your project to start with), you probably had it called something different to Ian’s “CSharpTest”, and that meant it couldn’t find it.
But yes step 1 is certainly to get that driver loaded so it’s recognised !!
Yes, that’s it (I hope)! I gave the program a completely different name! I’ll try altering that line to relflect the name I used. Meanwhile I don’t know what happend with the device recognition but it’s OK now! Will report back, hopefully this morning
Right. I called the project GadgeteerLedFlasher, so I altered the line ‘namespace…’ to suit. Now I get one error ‘An error has occurred. Check your hardware’. The device is recognised EMX.
And…yes! Now I have a very strange problem. The LED keeps on flashing although I have exited VS altogether (and reset the board too!), Thanks everyone. I got there at last and learned a lot. Now to get the mutlicolour led flashing… It’s the main board at the mo. Must have a shower namespace and then breakfast.
stopping Debugging in VS means only the communication with the bord
The program on the bord is running on without the PC
After the reboot the code starts allways again
Stopping the program means disconnect the power (->USB or DC)
That is excellent, the fact the LED flashes indicates that the code on the board is executing. When you reset the board boots straight into your code (over simplified, but good enough for now) and starts executing. Visual Studio only serves to get the code onto the board and to debug the code, other than that the code will run unattended.
Thanks everyone. I want to see that I am correctly understanding what happens. In visual Basic (and classic vb6) when you work in the IDE, you test with F5. When all is well you compile and then that program is an exe, say responding to a button being pressed on a form on the computer screen.
But it seems that in C# with an embedded device, F5 actually deploys the program to the board and the board then can run without the IDE, only needing the power. To do something else (like change the rate of flash) you would simply deploy a modified or fresh program by writing it and then F5 from the IDE. There is thus no compiling. It appears also that the deployed program will always be a kind of loop? Have I got that right please?
Now I am going to try and nut out flashing the multi led myself. No help required for this bit… yet!
But meanwhile, have got it going (not the mutiled yet – please don’t help with this part) ) on the 64 bit laptop but not on the 32 bit desktop (the 32/64 is probably a red herring). The message I am getting in the output window on the desktop is ‘Assembly: GHIElectronics.Gadgeteer.FEZSpider (1.1.1.0) needs assembly ‘GHI.Premium.System’ (4.2.7.0) Error a3000000’ . I’ve checked and everything appears identical.
Yes…except that it’s not unique to the language. If you had used the VB.NET code you would have seen the exact same result. This is a how microcontrollers work.
Not quite… If you look at the program you created you’ll see that we create a Timer that has a parameter of 250. That means that every 250ms the code that is bound to the Tick event will get fired. Had we not had the timer there then the light would have just blinked one time and that would have been the end of it until you rebooted the device. So, in reality a microcontroller without a loop is fairly useless. Just to fully explain…there actually is a background loop running that takes care of firing the Tick event at the correct times but Gadgeteer hides this from you.
Sounds like you’re on a roll now. Have fun!
Sounds like a firmware/SDK mismatch. You might need to try reinstalling your SDK on that box.
Re-installed. Same problem. Did not update as I updated on the laptop and surely that would overwrite it. But maybe they are different for 32 and 64 bit? BTW, device is visible in both machines and on f5 of the desktop the program appears to be cleared for the FEZ. Just that the same program does not appear to reload.
I believe there is only a 32-bit version of the SDK. USB drivers might be the only thing that’s different. Reinstall the firmware. It can get corrupted and require reinstallation.
Thanks for bearing with me Ian. Currently the FEZ works on the laptop but not the desktop. What should I reinstall or update exactly? and will it then stop the FEZ from working on the laptop? I’ve already reinstalled (on the desktop) following the 6 steps in setup.exe
…and while Im waiting for that, I see that the syntax for the multiled is completely different. I still don’t want handholding on this yet but I would like to be pointed at any on-line guide that lays out the syntax for all (or most!) of the GHI FEZ devices.
As long as you have the same version of the SDK on both machines and the same version of the firmware on your device, then it should work fine regardless of which machine you are on.
Do you mean the Multicolor (Daisylink) LED?
http://www.ghielectronics.com/catalog/product/272
It’s very simple. There are many examples of it’s use. I suggest you start working through the tutorials on the Support page.
http://www.ghielectronics.com/support/dotnet-micro-framework