PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Examples
Devices
Memory
EEPROM Data.c
1
/*
2
EEPROM Data.c
3
4
Write values and text to the Proepller Chip's dedicated EEPROM, and then
5
read back and display.
6
7
http://learn.parallax.com/propeller-c-tutorials
8
*/
9
10
#include "simpletools.h"
// Include simpletools header .
11
12
int
main
(
void
)
// main function
13
{
14
int
addr = 32769;
// Pick EEPROM base address.
15
16
ee_putInt(42, addr);
// 42 -> EEPROM address 32769
17
int
eeVal = ee_getInt(addr);
// EEPROM address 32769 -> eeVal
18
print(
"myVal = %d\n"
, eeVal);
// Display result
19
20
ee_putStr(
"hello!\n"
, 8, addr + 4);
// hello!\n -> EEPROM 32773..32780
21
char
s[8];
// Character array to hold string
22
ee_getStr(s, 8, addr + 4);
// EEPROM 32773..32780 -> s[0]..s[7]
23
print(
"s = %s"
, s);
// Display s array
24
}
25
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12