How to handle and event from pushing a physical button? - vb.net

Hello I am creating an application on vb.net which I want to launch an event whenever someone rings the doorbell. Can someone show me where I need to start looking? I know I need a circuit, but it should be very simple since I only want to push a button.
Thanks

An interesting hardware question. My solution here without additional hardware/circuit.
Install Microsoft Speech SDK.
Configure your MIC to listen to your doorbell.
In your code, on distinguishing the doorbell, invoke a button click in your screen. See below code to invoke a button:
'Imports System.Windows.Automation.Peers
'Imports System.Windows.Automation.Provider
If SpeechObject(DetectDoorBellRing) = True Then
Dim peer As New ButtonAutomationPeer(btnExecute)
Dim invokeProv As IInvokeProvider = TryCast(peer.GetPattern(PatternInterface.Invoke), IInvokeProvider)
invokeProv.Invoke()
End If

Arduino is a open-source hardware and supporting software project that you should be aware of. It's typically programmed in C or C++, but see "How to Communicate to the Arduino in Visual Basic .NET".
You might also pick up some good ideas from "How to Hack a Doorbell and Connect it to Twitter".
Finally, don't miss the Arduino StackExchange.

Related

Fail in loading flash loader on IAR Workbench

I am working on IAR Workbench platform V7.70.1 and I am triying to download a simple code (a simple main with a while(1) only into it), but I'm not succeding to download the code on the processor. I am using the board NUCLEO-F401RE of STM company, based on the processor STM32F401RE. I'm am getting the following message:
Failed to load flash loader: C:\Program Files\IAR Systems\Embedded Workbench 7.5\arm\config\flashloader\ST\FlashSTM32F401xE.flash
If someone is familiar with the issue, some help would save me. I read something about this issue on this link but I did not understand what I'm supposed to do:
Thank you in advance
the solution is very simple -
go to Project->Option->Debugger->Download - uncheck the checkbox "Override default.board file".
have a good day
Itshak
Look at the ST-Link reset type. Often the ST debug interface can not connect due to the processor state.
Form the menu bar select Project->Options then ST-Link from the list on the left. The Reset box is normally set to Normal but can be changed to Connect during reset which will hold the processor in reset while connecting the debugger before any code can execute.
For me this worked:
I erase my Port with "CrossCore Serial Flash Programmer"
Then under Project->Options->Debugger->CMSIS DAP->Setup I choose "Software".
Then I debug once.
Then I choose "Hardware" in the same setting window.
Debug again.
Then it worked. Some other software might mess up the correct serial settings, thats why you have to erase and reset them.

how to use serial communication to change the slides of powerpoint presentation?

I have an arduino uno kit. I 'll be giving it signals .These signals should be able to navigate the slides of powerpoint. Also these signals will be coming thru the serial port .
hence is there any software which allows me directly to do the required slide change ?Or should i be writing a code for the same ? If so in which language as iam quite new to this type of stuffs!
This is basically the same question as this one: What is the best way to access a serial port from VBA?
The answer refers to here: http://www.thescarms.com/vbasic/commio.aspx
One possibility would be to have the arduino emulate the serial mouse protocol and send mouse clicks for the Powerpoint navigation (just like pressing the mouse button to go to the next or previous slide). The problem is that as far as I know there are no serial mouse emulation libraries for Arduino, but I could be wrong.
Another option would be use use the LUFA USB library to have your UNO emulate a USB mouse. The problem with this option is that while LUFA is compatible with the UNO hardware, you need to reflash the firmware. And I believe you can't program it with the arduino IDE.
The easiest option would be to not use the UNO but get a Leonardo or a Teensy both can act as a USB Mouse device and can be programmed with the Arduino IDE.
The hardest part would be reading the serial data coming in and ensuring that it's valid. Then, depending on what command you receive (next slide, previous slide, etc.), send simulated mouse clicks or keyboard presses to PowerPoint. Better yet, you could just use the PowerPoint COM interface.

VB.NET Keybord tracker

Hello I have a VB NET application and I would like to add it a keybord key pressed catching system so I can track any keybord key that is pressed on any application that is running on my computer and uses keybord.
If someone has any idea thanks for sharing it.
I Hope my question was clear.
Thanks.
You will need to use a Global KeyBoard hook, look at this CodePlex Project. It will allow you to intercept the Global Keyboard events.
From Link:
This library allows you to tap keyboard and mouse and to detect and
record their activity even when an application is inactive and runs in
background.
This library attaches to windows global hooks, tracks keyboard and
mouse clicks and movement and raises common .NET events with
KeyEventArgs and MouseEventArgs, so you can easily retrieve any
information you need:

Controlling USB keyboard and mouse

We have a hardware device, with an LCD display. It supports an USB interface to connect keyboard and mose. Using these keyboard and mouse, we can navigate to varios menu items and edit entries.
We have couple of test cases written to verify that mouse click and keyboard input events are working when pressed respective key.
My task is to automate these test cases.
I donot have any control to the hardware device, as I can not access the o/s kernel or any application running there. There is one way to verify what is currently displayed on the UI. So I have to use that and verify whether the mouse/keyboard has performed the appropriate events.
As I have gone through couple of previous posts, it seems like that one of the way to achieve this is through virual HID device driver rather than actual keyboard and mosue. But I am not sure how to achieve it.
Please do help me for it. I am fine with any programming language.
I am more interested to simulate the mouse and keyboard events.
You probably don't need to write your own driver. AutoHotKey does pretty much anything you can think of, and the scripting language is quite easy to learn.
You can get it here:
http://www.autohotkey.com/
Since you're using linux, here's a similar project that will run on linux:
http://sikuli.org/

How does "Cinch App" do it?

If you aren't familiar with Cinch, its an application on Mac App Store that allows you to resize ANY window to half/full screen size if you drag the window to the edge of the screen. Exactly like the functionality in windows 7.
Now my question is, how is it done? I have looked all over cocoa apis looking for notifications/delegate methods for whenever a window is being dragged (ALL windows, not just windows owned by the app from which code is running from) but can't find it. Looked in Core Graphics API...Quartz Display Services....but can't find it.
Any help will be greatly appreciated as I have been looking for the past week....Thanks!
Edit: Resize the window is easy since it can be done through applescript bridge..
Are you developer behind i-Snap or some other Mac App Store clone of Cinch?
I'm the developer behind Cinch, and while I try to maintain an "abundance mentality" which basically says "There's enough out there for everyone", I've been upset by the Mac App Store lowering the barrier for entry to this market which has produced a number of half-backed competitors.
I would be thrilled to see some real innovation around the work I have done, and not just clones looking to make a quick buck.
Anyway, you want to look at the Accessibility APIs. It's a Carbon C API. This is probably your best reference: http://developer.apple.com/library/mac/#samplecode/UIElementInspector/Introduction/Intro.html%23//apple_ref/doc/uid/DTS10000728
I've not used the Cinch app, but if I were to do this I'd expect to be using cocoa events. (Also see here) Specifically the mouse handling events, combined with where the mouse is currently on-screen. They probably set a variable when a window is grabbed and then track the mouse pointer until it hits an edge or until they release the mouse button.
Events are very powerful and provide very low level access to what is happening, but can also be very complex. Good luck!
I'm not sure. Maybe the developers combine apple script and carbon events. You can create carbon events to know when the mouse has been clicked or dragged