thijse / arduino-libraries Goto Github PK
View Code? Open in Web Editor NEWArduino Libraries
Arduino Libraries
in this code snippet:
template < class T > T readBinArg ()
{
if (next ())
{
dumped = true;
return readBin < T > (current);
}
return (T)0;
}
seems that you want to convert a buffer to a class T, but if T is not a int or something that can be converted from 0, there will be a error when compiling this function.
May be return the pointer to T is a better choice?
in CmdMessenger.cpp, line 304 may overflow the msg buffer, suggest to use sizeof(msg) instead of 188.
298 void CmdMessenger::sendCmdfArg(char *fmt, ...)
299 {
300 if (startCommand) {
301 char msg[128];
302 va_list args;
303 va_start (args, fmt );
304 vsnprintf(msg, 188, fmt, args);
305 va_end (args);
306
307 comms->print(field_separator);
308 comms->print(msg);
309 }
310 }
Hi, I really enjoy with your read/write templates. But when I tried to reuse your library I stuck with many restrictions:
#define _EEPROMEX_DEBUG
. IMHO better way to use #ifndef _EEPROMEX_DEBUG true
. It will allow disable debugging and use unchanged libraryeeprom_read...
calls are spreaded over whole codevirtual
_memSize
, but not _allowedWrites
at the same timeisWriteOk(address+sizeof(value))
should be changed to isWriteOk(address+sizeof(value)-1)
I hope my contribution useful.
Thanks,
Evgeny
Double and Floats representation are depending on the system localization settings. The parse uses this representation settings.
See:
http://stackoverflow.com/questions/1354924/how-do-i-parse-a-string-with-a-decimal-point-to-a-double
Problem can be fixed by changing line 160 and 178 in ReceivedCommand to:
if (float.TryParse(_arguments[_parameter], System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out current))
EEPROMex can no longer be built using newer versions of gcc. It builds successefully on the Arduino-supplied avr-gcc 4.3, however building it using arduino-mk on a gcc 4.7 fails. GCC complains about conflicting definitions of EEPROM in EEPROMEx/EEPROMex.h:159.
In attempt to track this down further I ran the build in the Arduino IDE with full output. On gcc 4.3 this is a warning - possibly resulting in undefined behaviour? (I.e., sometimes EEPROM is used, sometimes EEPROMex)
So it seems that using EEPROMex as a drop-in replacement for EEPROM is no longer possible and at least the name of the global variable should be changed, e.g. from EEPROM to EEPROMex.
Another (possibly better) solution might be to replicate the necessary code from EEPROM in EEPROMex and eliminate the #include <EEPROM.h>. Otherwise, an instance of the EEPROM library may hang around costing valuable memory (Disclaimer: I'm no expert on what optimizations GCC can and will do in this case).
Hi,
I'd like to use CmdMessanger with Linux.
My Arduino devices are listed as /dev/ttyACM*
_serialTransport.CurrentSerialSettings.PortNameCollection
Does not list these devices. It does not seem to be a rights problem, as starting the Program as root does not help either. I also created a symlink sudo ln -s /dev/ttyACM0 /dev/ttySACM0
which got listed. Using this Symlink works but is no permanent solution.
According to this Bug report, this seems to be a mono Problem:
https://bugzilla.novell.com/show_bug.cgi?id=795366#c0
Anyway. I don't think I am the only Linux user, who to uses CmdMessanger. How do you solve this issue?
Hi I am using WriteBlock () function to save a structure, everything works fine, but when I unplug the card and flip on the read data is not exactly what keep bringing but a kind of special characters
This is the code I use to save
String readString = "write,192.168.0.189,http://sisfo.com/temp.php,5";
configurationValue.ip = getValue(readString,',',1);
configurationValue.url = getValue(readString,',',2);
configurationValue.time = getValue(readString,',',3);
EEPROM.WriteBlock(1, configurationValue);
This is the code i use to read
EEPROM.readBlock(1, configurationValueOut);
Arduino: 1.6.3 (Windows 8.1), TD: 1.23, Board: "Arduino Uno"
Build options changed, rebuilding all
Using library Time in folder: C:\Users\ASUS-PC\Documents\Arduino\libraries\Time
Using library EEPROMex in folder: C:\Users\ASUS-PC\Documents\Arduino\libraries\EEPROMex (1.0.x format)
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10603 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard -IC:\Users\ASUS-PC\Documents\Arduino\libraries\Time -IC:\Users\ASUS-PC\Documents\Arduino\libraries\EEPROMex C:\Users\ASUS-PC\AppData\Local\Temp\build8141211403291303415.tmp\EEPROMBackup.cpp -o C:\Users\ASUS-PC\AppData\Local\Temp\build8141211403291303415.tmp\EEPROMBackup.cpp.o
In file included from EEPROMBackup.pde:17:0:
C:\Users\ASUS-PC\Documents\Arduino\libraries\EEPROMex/EEPROMex.h:23:20: fatal error: EEPROM.h: No such file or directory
#include <EEPROM.h>
^
compilation terminated.
Error compiling.
if I include EEPROM in my main code then I get same problem with WProgram.h
I am using ardiuino 1.6.3...
It should be possible to turn off the max allowed writes check. I suggest the unix way: when argument is zero it means 'no check'. In the code
if (_allowedWrites > 0 && ( _writeCounts > _allowedWrites) ) {
Hello,
Is it possible add custom memory sizes ?
something like:
#define EEPROMSizeATmega1280 4096
#define EEPROMSize4M 4096
#define EEPROMSize8M 8192
#define EEPROMSize16M 16384
#define EEPROMSize32M 32768
When setting:
const int maxAllowedWrites = 1;
and using the updateByte function I get the error: "Exceeded maximum number of writes".
this does NOT happen if:
const int maxAllowedWrites = 2;
if I use writeByte and
const int maxAllowedWrites = 1;
the error does not appear.
The documentation on the Arduino website indicates that there's a sendCmd function available that doesn't require an argument (http://playground.arduino.cc/Code/CmdMessenger#.UzzMza1dWH8):
"When sending a command without parameters, the format is
sendCmd (int cmdId)"
However, when trying to call this method with a CmdMessenger object, I get the following error:
error: no matching function for call to 'CmdMessenger::sendCmd()'
The CmdMessenger file doesn't seem to include such a function in the header file. Is this function no longer supported?
GitHub doesn't let you programmatically download individual files but it does let you create Releases which can be downloaded. Could you tag your latest version as a 'release' so I can download it?
I'm working on a new IDE just for Arduino which will automatically download libraries when you use them, so having releases makes a huge difference. Otherwise the IDE has to check out the entire repo.
Hi,
Great library, thanks!
void setMemPool(int base, int memSize);
void setMaxAllowedWrites(int allowedWrites);
int getAddress(int noOfBytes);
uint8_t read(int);
bool readBit(int, byte);
uint8_t readByte(int);
uint16_t readInt(int);
uint32_t readLong(int);
float readFloat(int);
double readDouble(int);
bool write(int, uint8_t);
bool writeBit(int , uint8_t, bool);
Btw, the now widely-adopted convention adopted by the majority of recent large-scale projects is to use spaces instead of tabs.
Best,
Arthur
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.