Comments (3)
Oh, yes, that is on my would-like-to-do-list as well. Two different modules with these chips are already waiting for me on my desk. But I won't be able to find the time to do so in the next few months...
There is no need to start from scratch. You could use this as a starting point: https://github.com/avishorp/TM1637
There is some brief information about the preprocessor tricks used for sduino on the website. To keep things simple you build it a single instance library with constructor, as it is done for LiquidCrystal:
https://tenbaht.github.io/sduino/developer/macro/#single-instance-with-constructor
Hope that helps
from sduino.
In your liquidCrystal library variant int header you start with something like
void LiquidCrystal_init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7);
I tried like this for at least some beginning.
#ifndef __TM1637DISPLAY__
#define __TM1637DISPLAY__
#include <xmacro.h>
//#include <inttypes.h>
#define SEG_A 0b00000001
#define SEG_B 0b00000010
#define SEG_C 0b00000100
#define SEG_D 0b00001000
#define SEG_E 0b00010000
#define SEG_F 0b00100000
#define SEG_G 0b01000000
#ifdef __cplusplus
// C++ interface for use with regular gcc compiler
#else
void TM1637Display(uint8_t pinClk, uint8_t pinDIO);
#endif
#endif // __TM1637DISPLAY__
#include <TM1637Display.h>
#include <Arduino.h>
#define TM1637_I2C_COMM1 0x40
#define TM1637_I2C_COMM2 0xC0
#define TM1637_I2C_COMM3 0x80
void TM1637Display(uint8_t pinClk, uint8_t pinDIO)
{
// Copy the pin numbers
m_pinClk = pinClk;
m_pinDIO = pinDIO;
// Set the pin direction and default value.
// Both pins are set as inputs, allowing the pull-up resistors to pull them up
pinMode(m_pinClk, INPUT);
pinMode(m_pinDIO,INPUT);
digitalWrite(m_pinClk, LOW);
digitalWrite(m_pinDIO, LOW);
}
and well I've got this kind of error
Arduino/libraries/TM1637-master/TM1637Display.h:36: syntax error: token -> 'pinClk' ; column 33
how do you make this kind of init
from sduino.
I think it works can you check it https://github.com/Ikity/tm1637.git
from sduino.
Related Issues (20)
- 'Upload using programmer' fails with "Error while uploading: missing 'program.params.verbose' configuration parameter" HOT 3
- Arduino IDE 2.0.3 gives "Error: 13 INTERNAL: Cannot install platform: installing platform" HOT 1
- Sleep and interrupt in Sduino HOT 2
- FAQ: Output high frequency PWM ?
- Cannot get PC5 to be high
- Package install error: searching package root dir: no unique root dir in archive HOT 3
- Connect ESP32 and ARDUINO UNO to remotely control servo motor via Wi-Fi
- board manager url problem HOT 2
- ESP8266(ESPDUINO-32) A programmer is required to upload
- Autofeeding(wifi control, stepper motor)
- Installing the Board in the Arduino is failing HOT 4
- Error while uploading: missing 'program.params.quiet' configuration parameter HOT 1
- STM8S103 Mini_SSD1306 text print
- TIMER 2 interrupts not working
- Mere presence of (even unused) function with PinName argument makes DigitalWriteFast slower 10x HOT 2
- DMX functionality
- ASLink errors and madness.
- PWM with STM8S_StdPeriph_Driver
- Installing issue in Arduino board manager! HOT 2
- AWU_IRQHandler not working for STM8S
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 sduino.