hotaman / onewirespark Goto Github PK
View Code? Open in Web Editor NEWProvides support for the Dallas One Wire protocol on Particle devices.
License: MIT License
Provides support for the Dallas One Wire protocol on Particle devices.
License: MIT License
Veryfing code using this library in Particle Build fails with this error:
OneWire/OneWire.cpp:142:1: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin
HI,
I recently purchased a few DUO's from Redbear, they can be used in the Particle IDE and work fine. They combine both WiFi and BLE in almost the same footprint as the Photon.
Apperantly the Platform_ID is not a typical Particle ID and hence some code that checks the platform ID doesn't compile in the IDE.
Unfortnately also the OneWireSpak code.
Could you have a look at this ?
OneWire/OneWire.h:121:6: error: #error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core, Photon, P1 or Electron ***" #error "*** PLATFORM_ID not supported by this library. PLATFORM should be Core, Photon, P1 or Electron ***" ^
KR, Rudy
The Electron's not yet out, but compiling this on a prototype Electron gives me:
*** PLATFORM_ID not supported by this library. PLATFORM should be Core or Photon ***"
The Electron's PLATFORM_ID will be 10
, and I expect the implementation will be very similar (if not identical) to the Photon implementation.
I hope there is still interest in this project. I have not been able to get this code to work on the Raspberry Pi.
Veryfing code using this library in Particle Build fails with this error:
OneWire/OneWire.cpp:135:15: error: 'INPUT' was not declared in this scope
pinMode(pin, INPUT)
I maintain a DS18B20 lib for particle users and the new lib manager will allow for dependancies so I will no longer include a copy of your lib in mine. I was asked by some of the elites to migrate to the new low level IO functions instead of the pinmap method that has been used for so long. I am happy to complete this work but I need some guidance on a few things.
Low Leve Input/Output - Particle Docs
Example from reset()
digitalWriteFast(_pin, LOW);
pinModeFastOutput(); // drive output low
I have moved from digitalWriteFastLow to digitalWriteFast but the command after that is where I am confused. This is common in most functions and I am sure needed but I can't determine what it is doing besides setting the pin to output but wouldn't digitalWriteFast already have the pin in output mode? It says "drive output low" in the comments but the prior command will do the same. Please advise and I am happy to submit a PR if/when I get it all working. Thanks.
When using the Spark community version of the library, I get errors about the FALSE
definition (fixed in cec3788), but I don't when I use my own identical fork. I suspect Spark needs to be told to reimport the library.
Hi, have you ever encountered the following behaviour with your library? It's returning > 1200°C. It's pretty hot in the UK today, but not quite that hot :)
I'm using a Dallas 18B20
marked 1345C4 +210AA
.
ROM = 28 D F9 A1 5 0 0 12
Chip = DS18B20
Data = 1 5 4B 46 7F FF C 10 1C FF CRC=60
Temperature = 1200.31 Celsius, 2192.56 Fahrenheit
No more addresses.
An Arduino using the OneWire library with the same sensor and wiring provides:
ROM = 28 D F9 A1 5 0 0 12
Chip = DS18B20
Data = 1 D6 1 4B 46 7F FF A 10 43 CRC=43
Temperature = 29.37 Celsius, 84.87 Fahrenheit
No more addresses.
I've tried using both direct and parasitic power mode (Vcc tied to Gnd, 3V3 to 4.7k resistor on DQ), with the same output.
If I remove the sensor, I just get No more addresses.
, so I'm confident the Spark Core is receiving data. On an Arduino, CRC changes, but it seems to remain at 60
on the Spark Core.
Thanks!
Awesome this library supports the Photon -- thanks for that! I see that PLATFORM_ID with a compile error is directly handled in the header. Is there any reason that, if this library now works on the Photon (PLATFORM_ID = 6), then it cannot work on the P1 variant (PLATFORM_ID = 8). It certainly compiles and I can get around to testing it myself to verify, but thought I'd go ahead and ask since the PLATFORM_ID was not already explicitly included.
Hi, I fork this library example and try to verify/compile at spark.io/build and get errors:
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:29,
from readtemp.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]warning "Defaulting to Release Build"
^
readtemp.cpp:2:21: fatal error: OneWire.h: No such file or directoryinclude "application.h"
^
compilation terminated.
make: *** [readtemp.o] Error 1
Thanks for the contribution of the library! 👍
As discussed in this thread
https://community.particle.io/t/dallas-1-wire-onewire-lib-implementation-drive-or-float-high/19226
Could you please check if your way to drive the bus high actually conforms with the 1-wire specs?
But since you've done the port, you know best if there are reasons beyond what I saw when I looked at your code rather briefly.
In any case, just chime in on the thread linked above.
Veryfing code using this library in Particle Build fails with this error:
OneWire/OneWire.cpp:135:20: error: 'pinMode' was not declared in this scope
pinMode(pin, INPUT)
Hi @Hotaman,
We're noticing that there seems to be an new recent issue compiling this library in the IDE, did something change recently that would have impacted this? Anything we can do to help?
Thanks!
David
Veryfing code using this library in Particle Build fails with this error:
OneWire/OneWire.h:93:42: error: invalid pure specifier (only '= 0' is allowed) before '(' token
STM32_Pin_Info* PIN_MAP = HAL_Pin_Map()
Veryfing code using this library in Particle Build fails with this error:
OneWire/OneWire.cpp:146:1: error: 'GPIO_TypeDef' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.