0 Members and 1 Guest are viewing this topic.
nice it's good to see progress on this, it might be very useful when finished..
oh? when do you have to get it ready? that's a nice schoolproject.. what kind of studies are you doing?
wow, great, i love it did you manage to make it ? (maybe you already said it somewhere, but i must have missed that if you did)
Oh ok I was sure it was pretty soon, like tomorrow, and that you already finished the prototype.
#include <SPI.h>int Data = 6; //Data or TIP or REDint Clock = 7; //Clock or RING or WHITEbyte DRead = 0;byte DataByte = 0;void setup(){ Serial.begin(9600); delay(1000); Serial.println("Awesome Sauce! :)");}void loop(){ sendByte(127);}int sendByte(byte DataByte){ //initialize the contact with the mothership pinMode(Data, OUTPUT); pinMode(Clock, OUTPUT); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(1000); digitalWrite(Clock, LOW); delayMicroseconds(9000); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(52); delayMicroseconds(110); digitalWrite(Data, LOW); digitalWrite(Clock, LOW); delayMicroseconds(52); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(42); //send data now int BitIncrement; for(BitIncrement<=7; BitIncrement++;) { int SendBit; bitRead(DataByte, BitIncrement); digitalWrite(Data, SendBit); delayMicroseconds(17); digitalWrite(Clock, LOW); delayMicroseconds(35); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(52); }}int recieveByte(void){ //initialize contact with the daughtership pinMode(Data, INPUT); pinMode(Clock, INPUT); DRead = digitalRead(Data); return DRead;}
I, and many others, including you Keoni, have been wanting to interface the calculators serial with an Arduino. I've coded only sparsely in my life, just enough to get by. I use lots of example code to write programs, they're my crutch. So basically what I have right now is a Arduino program that sends a byte repeatedly through the link port using Kerm Martian's whitepaper on the Calcnet protocol to fix my timings. But the calc still receives nothing. I am using two programs on the calc to receive a byte. The built in GET command and my Omnicalc linkreceive() command. Neither of these get anything from my program on the Arduino. Here is my code:Code: [Select]#include <SPI.h>int Data = 6; //Data or TIP or REDint Clock = 7; //Clock or RING or WHITEbyte DRead = 0;byte DataByte = 0;void setup(){ Serial.begin(9600); delay(1000); Serial.println("Awesome Sauce! :)");}void loop(){ sendByte(127);}int sendByte(byte DataByte){ //initialize the contact with the mothership pinMode(Data, OUTPUT); pinMode(Clock, OUTPUT); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(1000); digitalWrite(Clock, LOW); delayMicroseconds(9000); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(52); delayMicroseconds(110); digitalWrite(Data, LOW); digitalWrite(Clock, LOW); delayMicroseconds(52); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(42); //send data now int BitIncrement; for(BitIncrement<=7; BitIncrement++;) { int SendBit; bitRead(DataByte, BitIncrement); digitalWrite(Data, SendBit); delayMicroseconds(17); digitalWrite(Clock, LOW); delayMicroseconds(35); digitalWrite(Data, HIGH); digitalWrite(Clock, HIGH); delayMicroseconds(52); }}int recieveByte(void){ //initialize contact with the daughtership pinMode(Data, INPUT); pinMode(Clock, INPUT); DRead = digitalRead(Data); return DRead;}