Comments (4)
WMath.cpp was missing from cores/pic32
Copied WMath.cpp from cores/arduino. Fixed srandom invocation to srand (stdlib) and random invocation to rand().
This is how working WMath.cpp looks like:
/* -- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -- */
/*
Part of the Wiring project - http://wiring.org.co
Copyright (c) 2004-06 Hernando Barragan
Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
extern "C" {
#include "stdlib.h"
}
void randomSeed(unsigned int seed)
{
if (seed != 0) {
srand(seed);
}
}
long random(long howbig)
{
if (howbig == 0) {
return 0;
}
return rand() % howbig;
}
long random(long howsmall, long howbig)
{
if (howsmall >= howbig) {
return howsmall;
}
long diff = howbig - howsmall;
return random(diff) + howsmall;
}
long map(long x, long in_min, long in_max, long out_min, long out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
unsigned int makeWord(unsigned int w) { return w; }
unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; }
from chipkit32-max.
Did you commit that to the master branch? It's not there, and I can certainly add it.
from chipkit32-max.
I am not changing the code from github, just my own local copy, so you can add it.
from chipkit32-max.
Done, and works.
from chipkit32-max.
Related Issues (20)
- Initialize device-specific features such as Floating-Point Unit in application startup code HOT 1
- Fix MPIDE splash screen to fix incorrect compatibility information HOT 1
- Create simple examples for SPI and DSPI libraries, include in Examples folder
- Create simple examples for DWTI library HOT 2
- Create new Software Serial library for Arduino 1.6.x compatibility HOT 1
- Create new build target getCore and have it copy chipKIt-core files to correct place
- Matrix and Sprite library no longer supported HOT 2
- Sync changes with chipKIT-core 20150903 HOT 1
- Added INO as default extension instead of PDE HOT 1
- bump version for release to 16778024
- Examples folder no longer shows up in MPIDE HOT 2
- Pull in code changes from issue #83 in core HOT 1
- Add define to allow sketches/library to know what IDE they're compiled under HOT 1
- Add -ftoplevel-reorder to c and c++ compile options HOT 1
- Fix over-ridden compiler options in boards.txt for -G1024 HOT 3
- Remove all vestiges of plilb.h from source HOT 5
- Re-code MPIDE so it doesn't use boards.txt at top level
- typedef struct compile error in mpide-20140316
- Updated FTDI driver to 2.12.10 HOT 1
- USB client stack problems HOT 18
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 chipkit32-max.