Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Homepage
Example usage:¶
http://andy.dynamicbits.com/hdradio/
#include "mbed.h"
#include "checksum.h"
DigitalOut myled(LED1);
template <int T>
struct data{
uint8_t buf[T];
uint8_t checksum;
};
data<12> all_ones = {{1,1,1,1,1,1,1,1,1,1,1,1}};
int main()
{
calculateChecksum( all_ones.buf, sizeof(all_ones) );
for(int i=0; i<sizeof(all_ones); i++)
{
printf("%02d: %d\n", i, *(all_ones.buf+i));
}
printf("checksum test: %s\n", (result)?"passed":"failed");
while(1)
{
myled = 1;
wait(0.2);
myled = 0;
wait(0.2);
}
}