softboard software breadboard

We all know the situation:
We spent so much time to build a project, but then something does not work...

Is the bug in my code, pin configuration, the wiring, defective hw items or where does it hide?

It would be so helpful being able to switch pin configuration/state for a test, or read and display it, watch the changing values that this new sensor delivers, try which PWM value is a good starting value for that robot, ... without having to add ever changing debug code to your sketch.

Thats why I wrote softboard.

First I included similar code in just about every sketch I wrote,
now I have factored it out to run as standalone sketch.

get it from GitHub - reppr/softboard: arduino software breadboard

Try it out, have fun,
Robert

from README softboard:

Arduino software breadboard.
Hardware/software developing/testing tool.

Simple hardware menu interface over serial line
as a kind of software breadboard

Read/set I/O pin configuration and states, switch pins on/off.
Read and write digital and analog values, switch pullup/high-z,
watch changing inputs over time.

Send 'm' over serial line and a menu will be sent back
displaying info on its one-letter commands.

Easy to write your own menu, but not documented yet...
Use it together with your own programs.

Installation:

Get it from GitHub - reppr/softboard: arduino software breadboard
Move the 'softboard' folder with all files
to your arduino sketchbook/ folder.
Load the sketch from arduino menu Files>Sketchbook>softboard.

Example 1: 'P13 OH' switch LED on (P select pin, O output, H high)
'L' off again (L low)

Example 2: 'P13 IH' pullup LED pin (P select pin, I input, H high)
LED glows at low level
'O' LED as OUTPUT now the LED is on

Example 3: Watch an analog input like a VU meter, changing over time.
See electric noise on unconnected floating A2 input
scrolling over your serial terminal.
(Touch the input if there is no visible signal.)

Now connect a sensor to the input and explore its data...

'P2 v' P=select pin (both analogue or digital)
v=display analog read values and bar graphs

175 ***********
190 ************
192 *************
181 ************
163 ***********
158 **********
164 ***********
181 ************
192 *************
190 ************
176 ************
161 ***********
159 **********
168 ***********
186 ************
194 *************
188 ************
170 ***********

Example 4: 'a' Display snapshot values on analog inputs.

[fixed font only]
pin value | | |
0 609 ***************************************
1 504 ********************************
2 451 *****************************
3 398 *************************
4 383 ************************
5 409 **************************

Example 5: '.' Display info about all pin's I/O configuration and states.

pin 0 I hi-z
pin 1 I hi-z
pin 2 O high
pin 3 O low
pin 4 I hi-z
*pin 5 I pullup // * indicates the selected pin
pin 6 I hi-z
pin 7 I hi-z
pin 8 I hi-z
pin 9 I hi-z
pin 10 I hi-z
pin 11 I hi-z
pin 12 I hi-z
pin 13 I pullup

How do i install this, not seeing anything in the README

Thanks

@ernestogrimes: it´s an ordinary arduino sketch. So make a folder named softboard in your sketchkook folder and put softboard.ino in there. Then the arduino gui will find it.

I have made a change to the source directory structure now to make installation even easier:

Get it from GitHub - reppr/softboard: arduino software breadboard
Move the 'softboard' folder with all files to your arduino sketchbook/ folder.
Load the sketch from arduino menu Files>Sketchbook>softboard.

Have fun!

I'm having a little trouble getting it to compile on 0022
I changed the directory name and the sketch to be acceptable but I get the following

It stops on

uint8_t mask = digitalPinToBitMask(pin);

and in the bottom terminal it shows:-

softboard.cpp: In function 'void pin_info(uint8_t)':
softboard:480: error: 'digitalPinToBitMask' was not declared in this scope
softboard:481: error: 'digitalPinToPort' was not declared in this scope
softboard:484: error: 'NOT_A_PIN' was not declared in this scope
softboard:496: error: 'portModeRegister' was not declared in this scope
softboard:504: error: 'portOutputRegister' was not declared in this scope
softboard:519: error: 'portOutputRegister' was not declared in this scope

@tytower: sorry, yes it´s only tested on Arduino 1.0
Is there a special reason you don´t use version 1.0?

I will have a look if I can do something for older versions.

Regarding pre arduino 1.0 version compatibility I have found this thread:
http://code.google.com/p/arduino/issues/detail?id=604&start=200

short version (adapt to your arduino version):
edit file arduino-0022/hardware/arduino/cores/arduino/wiring.h
comment out line 79 (round macro)
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
change that line to read
// #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

tested on arduino-0023

I have checked in a small change in my code which fixes things from my side.
The sketch should compile fine on older arduino versions now.

Thanks I'll give it another try
I have problems getting V1 up and running on my Linux Distro and have V0022 running on a stick so I can still play Arduino
V1 seems to have problems on Linux that I have not resolved yet

I have upadted the README, btw.
See Installation.

README softboard

Arduino software breadboard.
Hardware/software developing/testing tool.

Simple hardware menu interface over serial line
as a kind of software breadboard

Read/set I/O pin configuration and states, switch pins on/off.
Read and write digital and analog values, switch pullup/high-z,
watch changing inputs over time.

Send 'm' over serial line and a menu will be sent back
displaying info on its one-letter commands.

Easy to write your own menu, but not documented yet...
Use it together with your own programs.

Installation:

Get it from GitHub - reppr/softboard: arduino software breadboard
Move the 'softboard' folder with all files
to your arduino sketchbook/ folder.
Load the sketch from arduino menu Files>Sketchbook>softboard.

Older arduino versions than 1.0 need a fix:
see this thread:
http://code.google.com/p/arduino/issues/detail?id=604&start=200

short version (adapt to your arduino version)
edit file arduino-0022/hardware/arduino/cores/arduino/wiring.h
comment out line 79 (round macro)
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
tested on arduino-0023

For older arduino versions you also have to rename the sketch file
from softboard.ino to softboard.pde

How it works:

Communicate over serial. The minimalistic menu shows you one letter
commands to send. The menu reacts on these commands and reads numbers.

Example 1: 'P13 OH' switch LED on (P select pin, O output, H high)
'L' off again (L low)

Example 2: 'P13 IH' pullup LED pin (P select pin, I input, H high)
LED glows at low level
'O' LED as OUTPUT now the LED is on

Example 3: Watch an analog input like a VU meter, changing over time.
See electric noise on unconnected floating A2 input
scrolling over your serial terminal.
(Touch the input if there is no visible signal.)

Now connect a sensor to the input and explore its data...

'P2 v' P=select pin (both analogue or digital)
v=display analog read values and bar graphs

175 ***********
190 ************
192 *************
181 ************
163 ***********
158 **********
164 ***********
181 ************
192 *************
190 ************
176 ************
161 ***********
159 **********
168 ***********
186 ************
194 *************
188 ************
170 ***********

Example 4: 'a' Display snapshot values on analog inputs.

[fixed font only]
pin value | | |
0 609 ***************************************
1 504 ********************************
2 451 *****************************
3 398 *************************
4 383 ************************
5 409 **************************

Example 5: '.' Display info about all pin's I/O configuration and states.

pin 0 I hi-z
pin 1 I hi-z
pin 2 O high
pin 3 O low
pin 4 I hi-z
*pin 5 I pullup // * indicates the selected pin
pin 6 I hi-z
pin 7 I hi-z
pin 8 I hi-z
pin 9 I hi-z
pin 10 I hi-z
pin 11 I hi-z
pin 12 I hi-z
pin 13 I pullup