Comments (3)
The issue you're encountering with the output_pin
configuration in Mainsail, where the slider only sets values of 0 or 1 instead of the full 0-255 range, is due to how the slider's value is processed before sending the G-code command. The slider operates within a 0.0 to 1.0 range, and this value is directly used without conversion to the expected 0-255 range for PWM control.
To address this, the value sent by the slider needs to be adjusted to the 0-255 range before being formatted into the G-code command. This can be achieved by modifying the method that handles the slider's value, specifically by multiplying the slider's value (0.0 to 1.0) by 255 to convert it to the full range before sending the command. Here's a simplified adjustment you could make:
sendCmd(newVal: number): void {
// Convert newVal to a 0-255 range
newVal = newVal * 255;
let gcode = `SET_PIN PIN=${this.name} VALUE=${newVal.toFixed(0)}`;
// Send the G-code command
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' });
this.$socket.emit('printer.gcode.script', { script: gcode });
}
This change ensures that the slider's value is correctly scaled to the 0-255 range expected for PWM control before the G-code command is generated and sent. It's important to thoroughly test any modifications to confirm they work as expected and don't introduce new issues.
Details
Sources
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
from mainsail.
Hey @Guilouz! 👋 I'm Dosu, your friendly neighborhood bot here to help you tackle bugs, answer your questions, and guide you on your way to becoming a contributor. While we wait for a human maintainer to chime in, I'll be diving into your issue to lend a hand. Hang tight, I'll get back to you with more insights soon! 🤖
from mainsail.
Hey @Guilouz ,
you're right... the output pin is currently fixed to a value of 1
. We look further into it. There were some changes of the output_pin
module at the begining of the year. Looks like we did not address all those changes.
If you don't want to wait for a fix you could use fan_generic
Klipper Config Ref to controll a fan the same way.
from mainsail.
Related Issues (20)
- sensor_type: temperature_combined messes up the web UI HOT 2
- Description hover for macros
- Replace Stack Overflow logo with material icon HOT 3
- Add a maintenance page HOT 4
- No switching after adding printer HOT 4
- [Spoolman] Allow searching for spool by ID
- Overlay on video HOT 4
- Multiple Devices for Power On HOT 2
- Adding notes for G-code files HOT 3
- 404 Moonraker request without Maintenance
- Force Move Missing HOT 1
- Stick the "gcode files" table title to the top of the screen
- Weird acceleration values by running SHAPER_CALIBRATE (FlyAdxl345 by Mellow) HOT 4
- Different printer different web address HOT 3
- Filter on G-Code Files page
- Password Required during manual install of Mainsail. HOT 1
- Excessive amount of DNS requests HOT 2
- Consecutive and leading whitespace is not shown in console output
- [Feature Request] Cooling down sensor HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mainsail.