I have two STM32F4 Discovery boards (Board 1 and Board 2, let's say) and two different projects for the two boards in the same workspace.
Board 2 is dependent on an input from Board 1. In order to realize this, I flash Board 2 with its code first and then flash Board 1 with its own code.
I would like to know if this is the right way of programming when using two boards. Also, is there a possibility that I can debug the code of Board 2 while running the code of Board 1 since Board 2 reacts due to actions of Board 1.
Any help would be highly appreciated.
Related
I am using the STM32L476RG MCU, whenever I try running any code the notification “Active program deployed, board may require restarting”. I have tried hitting the reset button on the NUCLEO board as well as unplugging the board but the same issue prevails. Any advice/ tips much appreciated.
I am using MBED version (1.4.3.1).
I would like to get a PS4 controller to work on my PC and then relay the data to a microcontroller via UART.
The problem is, that I have no experience in C++ programming for Linux. The uC part is more in my favor.
Nevertheless, I would like to write a program which can set up a connection with a PS4 controller and read all buttons, sticks, motions and the track-pad. Also, it would be nice to be able to control rumble and the LED color.
I am using Ubuntu 16.4 and have read that the PS4 controller is natively supported since ver. 14.xx. But all I can find regarding a connection is how to set up the controller for steam or gaming in general.
But not how to get that status information and work with them using C++.
On the internet, I found some projects but they are all at least 3-4 years old and using an old version of Ubuntu. But since the controller is natively supported it would be nice to use it without outdated plugins/drivers which are obsolete anyway. I also started to look into HID-devices but that seems more like a workaround and I was hoping to find e.g. a library to include and use...
If someone can give me a hint, it would be greatly appreciated.
I did most of this on a raspberry pi but most of it still applies because the underlying drivers are mostly the same
Connecting: https://wiki.gentoo.org/wiki/Sony_DualShock look at the part about bluetoothctl and either try to follow that or get a wireless dongle. (That should set up automatically)
Controlls:
Your best bet is reading /dev/input/jsX where x is the number of the controller you are connected to (normally 0). This works with normal file reads so should really be no problem. This file contains everything from button presses to trackpad events and all other sensor data. It is event based so if you press a button you will get a 8 Byte burst of data. The structure looks like this:
1. Timestamp lowest byte
2. Timestamp second lowest byte
3. Timestamp second highest byte
4. Timestamp highest byte
5. Measured Data MSB
6. Measured Data LSB
7. Type (1 for Button. 2 for Axis (so a stick or another analog value))
8. ID Byte (so the id of the button you pressed. e.g.: 1 for x, 2 for square, 5 for left stick x)
LEDs:
This one is a bit more complicated. The only way i've found so far is accessing /sys/class/leds
That folder should contain a subfolder folder named something like 0005:054C:05C4.0009:<blue/green/red/global>
Those are your R/G/B channels. In these folders there are files called max_brightness and brightness To change the color to 0x00ff00 for instance write 0 to red 255 to green and 0 to blue
Hello I'm currently having a hard time with a project I'm working on.
It is a video game made using unreal engine 4 and i have to implement the network part on the project. So first of all, we have multiples pawn possessed by players, every player is allowed to spawn blocks(can be different type of blocks). We are currently using a Grid (an actor) that stores all the blocks in the world. We are using a GridManager ( an UObject) to manage the grid.
The GridManager can create AActor : BuildingAction, PushAction, FallingAction, and all others action that can be applied to any blocks in the grid. So i know that for spawning theses action and block i need to call RPCS from either the PlayerController or the pawn. The problem is that because the gridManager manages the grid and Spawn the actions on the world, the actions dont work on multiplayer. I guess spawning them in the player controller would work but it would need a function for every type of block and a function for every types of actions on the player controller, this would make no sense to store these functions on the player controller. If anyone could help me finding a good way to make this work on the network , it would be very helpful.
I'm creating simple online game in Qt Creator. I've created server project which analyse received data and take decisions. Also I created player project which sends requests to server for permission to move, shoot etc. Player project should be universal for Player 1 and Player 2.
Is there an option to run player project twice in Qt Creator?
I need it to test how server and player project behaves when second player connects.
I'm using Qt Creator 4.3.1: You can do that in Tools > Options... > Build & Run. Under the General tab, set the "Stop applications before building:" to "None"
Open 3 Qt Creators, 1 for the server 2 for the players and then run all of them. I have made a server-client multiplayer game in Qt and that is how i tested it.
For every client(player) open a Qt Creator.
EDIT:
You can also create release versions and start them, but you waste a lot of time creating a release version every time you want to debug.
I would like to know whether there exist games running on one computer but collecting input from two players using each a mouse or joystick connected to the same computer?
If they exist, how does the game keeps separated the data from the two mice/joysticks?
Thanks in advance, Stefan
Well, this seems to be similar to what you want. Teamplayer3 allows multiple mouse pointers at the same time: http://www.dicolab.com/products/teamplayer/
That is on windows. On *nix, check this project: http://www.icculus.org/manymouse/