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.
Diff: MAX6955.cpp
- Revision:
- 0:8c7de3096cac
- Child:
- 1:8936ddb97551
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MAX6955.cpp Tue Aug 02 14:10:14 2011 +0000
@@ -0,0 +1,29 @@
+#include "MAX6955.h"
+
+MAX6955::MAX6955(PinName sda, PinName scl, char driver): i2c_(sda, scl), driver_(driver){}
+
+int MAX6955::write(char command, char data){
+ char i2cData[2];
+ i2cData[0] = command;
+ i2cData[1] = data;
+ int result = i2c_.write(driver_, i2cData, 2);
+ wait(0.07);
+ return result;
+}
+
+int MAX6955::writeS(char* buffer){
+ int result = i2c_.write(driver_, (char *) buffer, 8);
+ wait(0.07);
+ return result;
+}
+
+int MAX6955::init(){
+ int result = 0;
+ result = result + write(reg_decodeMode, 0x00);
+ result = result + write(reg_scanLimit, 0x07);
+ result = result + write(reg_configuration, 0x21);
+ result = result + write(reg_globalIntensity, 0x08);
+ result = result + write(reg_digitType, 0xFF);
+ result = result + write(reg_displayTest, 0x00);
+ return result;
+}
\ No newline at end of file