The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [device-driver]

A device driver is a specialized software component (usually considered "system software") which allows a system to interact with a particular type or class of hardware device, such as a keyboard, serial port, disk drive, video display, memory controller, or other peripheral.

Filter by
Sorted by
Tagged with
2
votes
0answers
41 views

Motor control PLC in Python

Project description We have different types of devices like sov, motor, analog, digital, control valves etc. Each type of device has 100 items. Now our software continuously monitors with the PLC to ...
6
votes
1answer
40 views

VGA sync generator for 640x480@60Hz

I wrote my first module in Verilog. The purpose is to maintain two counters and emit signals corresponding to VGA's HSync and VSync, as well as HBlank and VBlank pulses to be used by a video ...
1
vote
0answers
39 views

Arduino code to control motor speed based on MPU-6050 sensor

I have been trying to create arduino code where my MPU6050 reads its angle and based on that angle, change the motor speed. For example, 45° is the max motor speed, 22° is roughly half speed, and so ...
2
votes
1answer
29 views

De-bouncing a (Gray) Rotary Encoder Switch in C

I would like feedback on the correctness and performance of this code. My priorities are also are readability, simplicity and self-documenting code - but I'm happy with those as they are. I still ...
4
votes
2answers
246 views

ROS node to control Dynamixel servo motors

This code is for a ROS (http://www.ros.org/) node that controls a pair of servo motors (referred to in the code as grippers) that can be controlled individually or together. When they are controlled ...
4
votes
0answers
349 views

Linux GPIO rotary encoder as volume control

I've written a kernel module (tested on Raspberry Pi) to use a rotary encoder as a volume control. The Linux source tree already contains a driver for rotary encoders so I've just piggybacked off of ...
6
votes
1answer
214 views

Sending instructions to an LCD display controlled by HD44780

My current embedded project uses a 16x2 LCD controlled by the HD44780 standard controller. My PIC18 speaks to the LCD via the Adafruit LCD serial backpack (schematic link). I chose the SPI interface. ...
3
votes
1answer
660 views

4x4 Matrix Keypad on Arduino UNO

I recently bought a 4x4 keypad. It is one like this: http://www.learningaboutelectronics.com/images/4x4-matrix-keypad-pinout.png Now every code I found on the net was either using a highly overloaded ...
1
vote
2answers
508 views

Dual state button algorithm in C

I wrote code for determining the push button state whether it is long pressed or not. This function is called by timer interrupt routine every 1ms. But it seems really dumb. How can I make it shorter ...
4
votes
1answer
163 views

Attaching an interrupt to a member function

I am making my own optical encoders. Each of them follows the exact same structure, so I figured I'd lump all the encoder processing in a class, StepCounter. ...
7
votes
1answer
204 views

Lightweight LED library

One of the projects that have been on my to-do list since years involves controlling a number of Inter-Integrated Circuit (\$I^2C\$) peripherals. Lately I've been turning everything into it's own ...
2
votes
1answer
440 views

7-segment 4-digit display

Is there a better way to organize the methods within this program without compromising the clarity? Running through digits 0-9 with separate functions seems very bulky. ...
2
votes
1answer
665 views

Building thermostat state machine in Python

I used a Raspberry Pi and Adafruit LCD with buttons to build a small thermostat for my house. This is the hardware I used to you can imagine how the button and the code work: https://www.adafruit.com/...
4
votes
2answers
534 views

18 Motor, 6 Legged robot walking using Python / ROS

I have been using ROS alongside Python to enable my built robot to walk. I am aware that my code needs some improvement such as classes etc. This is my first Python / ROS program so any help and ...
7
votes
1answer
4k views

Verilog UART Transmitter

This is one of the first Verilog programs I have written. I have a Xilinx Artix-7 FPGA card. Right now I just have it transmitting an "X" every second. It works and I can see the result in my serial ...
5
votes
1answer
494 views

Processing text messages from a GSM module

I have a Tiva TM4C ARM processor connected to a GSM modem (SIM900). When the GSM modem receives a new text message it sends a UART string to the MCU, where an interrupt routine increments a new ...
6
votes
3answers
162 views

Microgrid device driver controlling GSM modem, LCD, keypad, and relays

I have an MCU (TI Tiva TM4C) that operates a GSM modem, LCD display, keypad, ADC inputs, and four relays for microgrid control/operation. To date I have about 2000 lines of code, mostly for ...
3
votes
5answers
129 views

Toggle four relays on/off based on bitmap stored in uint8_t

I am using a one-byte bitmap to control four relays. I am writing a function which will take the bitmap stored as uint8_t, look to see which bits are set/cleared, ...
1
vote
1answer
656 views

Xbox controller wrapper

I spent far too much time trying to simply get data from an Xbox controller with Python. This is the cleaned up result, classified. This requires xinput1_3 or possibly 1_4 - I'm running Windows 7 and ...
8
votes
1answer
426 views

Class that is used to run a 5x5x5 RGB cube

I had a hardware project for a 5x5x5 RGB cube which is driven by a 22118400Hz 8-bit AVR (1284p for those who like hardware). Basically, the class sets the bits in a huge array of 8-bit values (...
11
votes
1answer
1k views

Callback in Linux kernel driver in order to hide device's low-level protocol

I'm am writing a Linux kernel driver for HD44780 LCDs connected via I2C bus. In my last change I tried to decouple low-level code (which talks to the device via I2C) from device's logic (printing ...
2
votes
1answer
3k views

Keyboard input class

I am looking for advice on my input component. There is no real problem with it yet, but I am just getting started on everything and want to know if there is any obvious problems with it, plus I was ...
7
votes
1answer
127 views

Detecting two keys pressed in quick succession

My computer has been having this issue where when I press a key, two key presses get registered. The goal of this program is to detect the time delta between the two keys so that I can set an ...
3
votes
0answers
886 views

Defining a char device driver protocol over uart at kernel level

My aim is to write a blocking char driver that return to the user space a complete protocol message from the kernel uart driver. Protocol description I'm fighting with a very bad protocol, called ...
2
votes
1answer
140 views

Decode an alarm keypad message

In my efforts to learn the Swift language, I am trying to mix in a pet project along with my learning of the basic language syntax. In essence, i'm trying to write an iOS keypad application to work ...
5
votes
2answers
78 views

Automated test system

I am creating an automated test system (scope bloat - the original intent was a one-off bash automation of a particular test case that has turned into creating a system that will do many other things)....
3
votes
2answers
184 views

Synchronous and asynchronous motor movement

I am working on an API that is mostly intended to be used interactively/little scripts. There are some classes with methods that could act slightly differently depending on the intention of the user, ...
3
votes
2answers
3k views

Interfacing with instruments using pyvisa

I'm new to Python, and after running through some introductory exercises I wrote a class definition for working with some hardware, specifically a Signal Recovery model 7230 lockin amplifier. In the ...
0
votes
1answer
548 views

Blinking LED code at a particular frequency [closed]

I wrote a function for interacting with my PIC16F1788. The code sends pulses out the RC4 port at a specific frequency, to make ...
2
votes
1answer
3k views

Driving 7-segment displays

I made a little JavaScript app here that let people generate bitmap for generating characters. Currently it generate code of a dictionary. But I want to also generate a example that let them play like ...
1
vote
0answers
77 views

Enhancement to Trezor library for Android

I'm only asking because I'm new and don't know enough to have a concrete question. Did I do this correctly? I worked on this until the code performed as expected, but I don't think I'm done. In ...
5
votes
6answers
792 views

TCP communication with step motor

I have a class that I use to communicate with some hardware equipment (a step motor to be precise): ...
10
votes
2answers
280 views

Embedded C# bitpacked arrays to low-level STM32F4 driver for GE G35 RGB LED Christmas tree light

I'm going to be opensourcing some code I'm working on. I don't need help with the code, I just want to make sure my code is readable and my comments make sense. I have a knack for the esoteric. ...
3
votes
1answer
2k views

Python lookup table

I'm trying to design a protocol for sending/receiving serial data. The basic plan is to allow for text data to be entered in the command prompt, translate that to a hex string and send it out over ...
5
votes
1answer
4k views

Programming Principles - Reading/writing from/to a Mifare card

Consider the following class (I've stripped XML doc for the sake of simplicity), which does several and slightly different operations through a serial port to read/write from/to a Mifare card. It has ...
11
votes
1answer
2k views

Door-opener program

I've been working on a little project on an Arduino and I need some help with making the code more efficient / cleaner. I really don't like the three for loops and ...
6
votes
1answer
662 views

Blocking and async UDP communication with an IR camera

I'm writing a Java application to control a custom IR research camera that will be installed on an aircraft. The camera connects to the the computer using UDP sockets via a direct LAN cable. The ...
6
votes
2answers
432 views

Keeping track of byte count in a binary protocol handler

I am putting together a fairly simple server that listens for a connection then creates this thread - textbook Java code - then accepts data on that connection. I am following a protocol that the ...
3
votes
1answer
146 views

Servo commands based on serial port input

Straight to the point: Can you give me pointers on how to make this code more maintainable? In the future, I want to add more more things to this, but first it should be easy to maintain/read. Should ...